Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- openflamingo/lib/python3.10/site-packages/numpy/ma/__pycache__/extras.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/testing/_private/__pycache__/__init__.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/testing/_private/utils.pyi +402 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/__init__.py +175 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/mypy_plugin.py +196 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_isfile.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_runtime.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_typing.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_pad.pyi +6 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/comparisons.pyi +27 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/multiarray.pyi +55 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arithmetic.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_like.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayprint.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayterator.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/bitwise_ops.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/flatiter.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/fromnumeric.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/modules.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_conversion.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_shape_manipulation.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/random.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple_py3.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunc_config.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunclike.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufuncs.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/warnings_and_errors.cpython-310.pyc +0 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/array_constructors.py +137 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/comparisons.py +301 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/einsumfunc.py +36 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/fromnumeric.py +260 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/index_tricks.py +64 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/literal.py +47 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/mod.py +149 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/numerictypes.py +42 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/random.py +1499 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/scalars.py +248 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/simple.py +165 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/warnings_and_errors.py +6 -0
- openflamingo/lib/python3.10/site-packages/numpy/typing/tests/test_typing.py +300 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_stmts.f90 +20 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_with_comments.f +8 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/foo_deps.f90 +6 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598Warn.f90 +11 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/pubprivmod.f90 +10 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/negative_bounds/issue_20853.f90 +7 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_character/foo77.f +45 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_character/foo90.f90 +48 -0
- phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_real/foo77.f +45 -0
openflamingo/lib/python3.10/site-packages/numpy/ma/__pycache__/extras.cpython-310.pyc
ADDED
|
Binary file (57.2 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/testing/_private/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (180 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/testing/_private/utils.pyi
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
import ast
|
| 4 |
+
import types
|
| 5 |
+
import warnings
|
| 6 |
+
import unittest
|
| 7 |
+
import contextlib
|
| 8 |
+
from re import Pattern
|
| 9 |
+
from collections.abc import Callable, Iterable, Sequence
|
| 10 |
+
from typing import (
|
| 11 |
+
Literal as L,
|
| 12 |
+
Any,
|
| 13 |
+
AnyStr,
|
| 14 |
+
ClassVar,
|
| 15 |
+
NoReturn,
|
| 16 |
+
overload,
|
| 17 |
+
type_check_only,
|
| 18 |
+
TypeVar,
|
| 19 |
+
Union,
|
| 20 |
+
Final,
|
| 21 |
+
SupportsIndex,
|
| 22 |
+
)
|
| 23 |
+
if sys.version_info >= (3, 10):
|
| 24 |
+
from typing import ParamSpec
|
| 25 |
+
else:
|
| 26 |
+
from typing_extensions import ParamSpec
|
| 27 |
+
|
| 28 |
+
from numpy import generic, dtype, number, object_, bool_, _FloatValue
|
| 29 |
+
from numpy._typing import (
|
| 30 |
+
NDArray,
|
| 31 |
+
ArrayLike,
|
| 32 |
+
DTypeLike,
|
| 33 |
+
_ArrayLikeNumber_co,
|
| 34 |
+
_ArrayLikeObject_co,
|
| 35 |
+
_ArrayLikeTD64_co,
|
| 36 |
+
_ArrayLikeDT64_co,
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
from unittest.case import (
|
| 40 |
+
SkipTest as SkipTest,
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
_P = ParamSpec("_P")
|
| 44 |
+
_T = TypeVar("_T")
|
| 45 |
+
_ET = TypeVar("_ET", bound=BaseException)
|
| 46 |
+
_FT = TypeVar("_FT", bound=Callable[..., Any])
|
| 47 |
+
|
| 48 |
+
# Must return a bool or an ndarray/generic type
|
| 49 |
+
# that is supported by `np.logical_and.reduce`
|
| 50 |
+
_ComparisonFunc = Callable[
|
| 51 |
+
[NDArray[Any], NDArray[Any]],
|
| 52 |
+
Union[
|
| 53 |
+
bool,
|
| 54 |
+
bool_,
|
| 55 |
+
number[Any],
|
| 56 |
+
NDArray[Union[bool_, number[Any], object_]],
|
| 57 |
+
],
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
__all__: list[str]
|
| 61 |
+
|
| 62 |
+
class KnownFailureException(Exception): ...
|
| 63 |
+
class IgnoreException(Exception): ...
|
| 64 |
+
|
| 65 |
+
class clear_and_catch_warnings(warnings.catch_warnings):
|
| 66 |
+
class_modules: ClassVar[tuple[types.ModuleType, ...]]
|
| 67 |
+
modules: set[types.ModuleType]
|
| 68 |
+
@overload
|
| 69 |
+
def __new__(
|
| 70 |
+
cls,
|
| 71 |
+
record: L[False] = ...,
|
| 72 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 73 |
+
) -> _clear_and_catch_warnings_without_records: ...
|
| 74 |
+
@overload
|
| 75 |
+
def __new__(
|
| 76 |
+
cls,
|
| 77 |
+
record: L[True],
|
| 78 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 79 |
+
) -> _clear_and_catch_warnings_with_records: ...
|
| 80 |
+
@overload
|
| 81 |
+
def __new__(
|
| 82 |
+
cls,
|
| 83 |
+
record: bool,
|
| 84 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 85 |
+
) -> clear_and_catch_warnings: ...
|
| 86 |
+
def __enter__(self) -> None | list[warnings.WarningMessage]: ...
|
| 87 |
+
def __exit__(
|
| 88 |
+
self,
|
| 89 |
+
__exc_type: None | type[BaseException] = ...,
|
| 90 |
+
__exc_val: None | BaseException = ...,
|
| 91 |
+
__exc_tb: None | types.TracebackType = ...,
|
| 92 |
+
) -> None: ...
|
| 93 |
+
|
| 94 |
+
# Type-check only `clear_and_catch_warnings` subclasses for both values of the
|
| 95 |
+
# `record` parameter. Copied from the stdlib `warnings` stubs.
|
| 96 |
+
|
| 97 |
+
@type_check_only
|
| 98 |
+
class _clear_and_catch_warnings_with_records(clear_and_catch_warnings):
|
| 99 |
+
def __enter__(self) -> list[warnings.WarningMessage]: ...
|
| 100 |
+
|
| 101 |
+
@type_check_only
|
| 102 |
+
class _clear_and_catch_warnings_without_records(clear_and_catch_warnings):
|
| 103 |
+
def __enter__(self) -> None: ...
|
| 104 |
+
|
| 105 |
+
class suppress_warnings:
|
| 106 |
+
log: list[warnings.WarningMessage]
|
| 107 |
+
def __init__(
|
| 108 |
+
self,
|
| 109 |
+
forwarding_rule: L["always", "module", "once", "location"] = ...,
|
| 110 |
+
) -> None: ...
|
| 111 |
+
def filter(
|
| 112 |
+
self,
|
| 113 |
+
category: type[Warning] = ...,
|
| 114 |
+
message: str = ...,
|
| 115 |
+
module: None | types.ModuleType = ...,
|
| 116 |
+
) -> None: ...
|
| 117 |
+
def record(
|
| 118 |
+
self,
|
| 119 |
+
category: type[Warning] = ...,
|
| 120 |
+
message: str = ...,
|
| 121 |
+
module: None | types.ModuleType = ...,
|
| 122 |
+
) -> list[warnings.WarningMessage]: ...
|
| 123 |
+
def __enter__(self: _T) -> _T: ...
|
| 124 |
+
def __exit__(
|
| 125 |
+
self,
|
| 126 |
+
__exc_type: None | type[BaseException] = ...,
|
| 127 |
+
__exc_val: None | BaseException = ...,
|
| 128 |
+
__exc_tb: None | types.TracebackType = ...,
|
| 129 |
+
) -> None: ...
|
| 130 |
+
def __call__(self, func: _FT) -> _FT: ...
|
| 131 |
+
|
| 132 |
+
verbose: int
|
| 133 |
+
IS_PYPY: Final[bool]
|
| 134 |
+
IS_PYSTON: Final[bool]
|
| 135 |
+
HAS_REFCOUNT: Final[bool]
|
| 136 |
+
HAS_LAPACK64: Final[bool]
|
| 137 |
+
|
| 138 |
+
def assert_(val: object, msg: str | Callable[[], str] = ...) -> None: ...
|
| 139 |
+
|
| 140 |
+
# Contrary to runtime we can't do `os.name` checks while type checking,
|
| 141 |
+
# only `sys.platform` checks
|
| 142 |
+
if sys.platform == "win32" or sys.platform == "cygwin":
|
| 143 |
+
def memusage(processName: str = ..., instance: int = ...) -> int: ...
|
| 144 |
+
elif sys.platform == "linux":
|
| 145 |
+
def memusage(_proc_pid_stat: str | bytes | os.PathLike[Any] = ...) -> None | int: ...
|
| 146 |
+
else:
|
| 147 |
+
def memusage() -> NoReturn: ...
|
| 148 |
+
|
| 149 |
+
if sys.platform == "linux":
|
| 150 |
+
def jiffies(
|
| 151 |
+
_proc_pid_stat: str | bytes | os.PathLike[Any] = ...,
|
| 152 |
+
_load_time: list[float] = ...,
|
| 153 |
+
) -> int: ...
|
| 154 |
+
else:
|
| 155 |
+
def jiffies(_load_time: list[float] = ...) -> int: ...
|
| 156 |
+
|
| 157 |
+
def build_err_msg(
|
| 158 |
+
arrays: Iterable[object],
|
| 159 |
+
err_msg: str,
|
| 160 |
+
header: str = ...,
|
| 161 |
+
verbose: bool = ...,
|
| 162 |
+
names: Sequence[str] = ...,
|
| 163 |
+
precision: None | SupportsIndex = ...,
|
| 164 |
+
) -> str: ...
|
| 165 |
+
|
| 166 |
+
def assert_equal(
|
| 167 |
+
actual: object,
|
| 168 |
+
desired: object,
|
| 169 |
+
err_msg: str = ...,
|
| 170 |
+
verbose: bool = ...,
|
| 171 |
+
) -> None: ...
|
| 172 |
+
|
| 173 |
+
def print_assert_equal(
|
| 174 |
+
test_string: str,
|
| 175 |
+
actual: object,
|
| 176 |
+
desired: object,
|
| 177 |
+
) -> None: ...
|
| 178 |
+
|
| 179 |
+
def assert_almost_equal(
|
| 180 |
+
actual: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 181 |
+
desired: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 182 |
+
decimal: int = ...,
|
| 183 |
+
err_msg: str = ...,
|
| 184 |
+
verbose: bool = ...,
|
| 185 |
+
) -> None: ...
|
| 186 |
+
|
| 187 |
+
# Anything that can be coerced into `builtins.float`
|
| 188 |
+
def assert_approx_equal(
|
| 189 |
+
actual: _FloatValue,
|
| 190 |
+
desired: _FloatValue,
|
| 191 |
+
significant: int = ...,
|
| 192 |
+
err_msg: str = ...,
|
| 193 |
+
verbose: bool = ...,
|
| 194 |
+
) -> None: ...
|
| 195 |
+
|
| 196 |
+
def assert_array_compare(
|
| 197 |
+
comparison: _ComparisonFunc,
|
| 198 |
+
x: ArrayLike,
|
| 199 |
+
y: ArrayLike,
|
| 200 |
+
err_msg: str = ...,
|
| 201 |
+
verbose: bool = ...,
|
| 202 |
+
header: str = ...,
|
| 203 |
+
precision: SupportsIndex = ...,
|
| 204 |
+
equal_nan: bool = ...,
|
| 205 |
+
equal_inf: bool = ...,
|
| 206 |
+
*,
|
| 207 |
+
strict: bool = ...
|
| 208 |
+
) -> None: ...
|
| 209 |
+
|
| 210 |
+
def assert_array_equal(
|
| 211 |
+
x: ArrayLike,
|
| 212 |
+
y: ArrayLike,
|
| 213 |
+
err_msg: str = ...,
|
| 214 |
+
verbose: bool = ...,
|
| 215 |
+
*,
|
| 216 |
+
strict: bool = ...
|
| 217 |
+
) -> None: ...
|
| 218 |
+
|
| 219 |
+
def assert_array_almost_equal(
|
| 220 |
+
x: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 221 |
+
y: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 222 |
+
decimal: float = ...,
|
| 223 |
+
err_msg: str = ...,
|
| 224 |
+
verbose: bool = ...,
|
| 225 |
+
) -> None: ...
|
| 226 |
+
|
| 227 |
+
@overload
|
| 228 |
+
def assert_array_less(
|
| 229 |
+
x: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 230 |
+
y: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 231 |
+
err_msg: str = ...,
|
| 232 |
+
verbose: bool = ...,
|
| 233 |
+
) -> None: ...
|
| 234 |
+
@overload
|
| 235 |
+
def assert_array_less(
|
| 236 |
+
x: _ArrayLikeTD64_co,
|
| 237 |
+
y: _ArrayLikeTD64_co,
|
| 238 |
+
err_msg: str = ...,
|
| 239 |
+
verbose: bool = ...,
|
| 240 |
+
) -> None: ...
|
| 241 |
+
@overload
|
| 242 |
+
def assert_array_less(
|
| 243 |
+
x: _ArrayLikeDT64_co,
|
| 244 |
+
y: _ArrayLikeDT64_co,
|
| 245 |
+
err_msg: str = ...,
|
| 246 |
+
verbose: bool = ...,
|
| 247 |
+
) -> None: ...
|
| 248 |
+
|
| 249 |
+
def runstring(
|
| 250 |
+
astr: str | bytes | types.CodeType,
|
| 251 |
+
dict: None | dict[str, Any],
|
| 252 |
+
) -> Any: ...
|
| 253 |
+
|
| 254 |
+
def assert_string_equal(actual: str, desired: str) -> None: ...
|
| 255 |
+
|
| 256 |
+
def rundocs(
|
| 257 |
+
filename: None | str | os.PathLike[str] = ...,
|
| 258 |
+
raise_on_error: bool = ...,
|
| 259 |
+
) -> None: ...
|
| 260 |
+
|
| 261 |
+
def raises(*args: type[BaseException]) -> Callable[[_FT], _FT]: ...
|
| 262 |
+
|
| 263 |
+
@overload
|
| 264 |
+
def assert_raises( # type: ignore
|
| 265 |
+
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
| 266 |
+
callable: Callable[_P, Any],
|
| 267 |
+
/,
|
| 268 |
+
*args: _P.args,
|
| 269 |
+
**kwargs: _P.kwargs,
|
| 270 |
+
) -> None: ...
|
| 271 |
+
@overload
|
| 272 |
+
def assert_raises(
|
| 273 |
+
expected_exception: type[_ET] | tuple[type[_ET], ...],
|
| 274 |
+
*,
|
| 275 |
+
msg: None | str = ...,
|
| 276 |
+
) -> unittest.case._AssertRaisesContext[_ET]: ...
|
| 277 |
+
|
| 278 |
+
@overload
|
| 279 |
+
def assert_raises_regex(
|
| 280 |
+
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
| 281 |
+
expected_regex: str | bytes | Pattern[Any],
|
| 282 |
+
callable: Callable[_P, Any],
|
| 283 |
+
/,
|
| 284 |
+
*args: _P.args,
|
| 285 |
+
**kwargs: _P.kwargs,
|
| 286 |
+
) -> None: ...
|
| 287 |
+
@overload
|
| 288 |
+
def assert_raises_regex(
|
| 289 |
+
expected_exception: type[_ET] | tuple[type[_ET], ...],
|
| 290 |
+
expected_regex: str | bytes | Pattern[Any],
|
| 291 |
+
*,
|
| 292 |
+
msg: None | str = ...,
|
| 293 |
+
) -> unittest.case._AssertRaisesContext[_ET]: ...
|
| 294 |
+
|
| 295 |
+
def decorate_methods(
|
| 296 |
+
cls: type[Any],
|
| 297 |
+
decorator: Callable[[Callable[..., Any]], Any],
|
| 298 |
+
testmatch: None | str | bytes | Pattern[Any] = ...,
|
| 299 |
+
) -> None: ...
|
| 300 |
+
|
| 301 |
+
def measure(
|
| 302 |
+
code_str: str | bytes | ast.mod | ast.AST,
|
| 303 |
+
times: int = ...,
|
| 304 |
+
label: None | str = ...,
|
| 305 |
+
) -> float: ...
|
| 306 |
+
|
| 307 |
+
@overload
|
| 308 |
+
def assert_allclose(
|
| 309 |
+
actual: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 310 |
+
desired: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 311 |
+
rtol: float = ...,
|
| 312 |
+
atol: float = ...,
|
| 313 |
+
equal_nan: bool = ...,
|
| 314 |
+
err_msg: str = ...,
|
| 315 |
+
verbose: bool = ...,
|
| 316 |
+
) -> None: ...
|
| 317 |
+
@overload
|
| 318 |
+
def assert_allclose(
|
| 319 |
+
actual: _ArrayLikeTD64_co,
|
| 320 |
+
desired: _ArrayLikeTD64_co,
|
| 321 |
+
rtol: float = ...,
|
| 322 |
+
atol: float = ...,
|
| 323 |
+
equal_nan: bool = ...,
|
| 324 |
+
err_msg: str = ...,
|
| 325 |
+
verbose: bool = ...,
|
| 326 |
+
) -> None: ...
|
| 327 |
+
|
| 328 |
+
def assert_array_almost_equal_nulp(
|
| 329 |
+
x: _ArrayLikeNumber_co,
|
| 330 |
+
y: _ArrayLikeNumber_co,
|
| 331 |
+
nulp: float = ...,
|
| 332 |
+
) -> None: ...
|
| 333 |
+
|
| 334 |
+
def assert_array_max_ulp(
|
| 335 |
+
a: _ArrayLikeNumber_co,
|
| 336 |
+
b: _ArrayLikeNumber_co,
|
| 337 |
+
maxulp: float = ...,
|
| 338 |
+
dtype: DTypeLike = ...,
|
| 339 |
+
) -> NDArray[Any]: ...
|
| 340 |
+
|
| 341 |
+
@overload
|
| 342 |
+
def assert_warns(
|
| 343 |
+
warning_class: type[Warning],
|
| 344 |
+
) -> contextlib._GeneratorContextManager[None]: ...
|
| 345 |
+
@overload
|
| 346 |
+
def assert_warns(
|
| 347 |
+
warning_class: type[Warning],
|
| 348 |
+
func: Callable[_P, _T],
|
| 349 |
+
/,
|
| 350 |
+
*args: _P.args,
|
| 351 |
+
**kwargs: _P.kwargs,
|
| 352 |
+
) -> _T: ...
|
| 353 |
+
|
| 354 |
+
@overload
|
| 355 |
+
def assert_no_warnings() -> contextlib._GeneratorContextManager[None]: ...
|
| 356 |
+
@overload
|
| 357 |
+
def assert_no_warnings(
|
| 358 |
+
func: Callable[_P, _T],
|
| 359 |
+
/,
|
| 360 |
+
*args: _P.args,
|
| 361 |
+
**kwargs: _P.kwargs,
|
| 362 |
+
) -> _T: ...
|
| 363 |
+
|
| 364 |
+
@overload
|
| 365 |
+
def tempdir(
|
| 366 |
+
suffix: None = ...,
|
| 367 |
+
prefix: None = ...,
|
| 368 |
+
dir: None = ...,
|
| 369 |
+
) -> contextlib._GeneratorContextManager[str]: ...
|
| 370 |
+
@overload
|
| 371 |
+
def tempdir(
|
| 372 |
+
suffix: None | AnyStr = ...,
|
| 373 |
+
prefix: None | AnyStr = ...,
|
| 374 |
+
dir: None | AnyStr | os.PathLike[AnyStr] = ...,
|
| 375 |
+
) -> contextlib._GeneratorContextManager[AnyStr]: ...
|
| 376 |
+
|
| 377 |
+
@overload
|
| 378 |
+
def temppath(
|
| 379 |
+
suffix: None = ...,
|
| 380 |
+
prefix: None = ...,
|
| 381 |
+
dir: None = ...,
|
| 382 |
+
text: bool = ...,
|
| 383 |
+
) -> contextlib._GeneratorContextManager[str]: ...
|
| 384 |
+
@overload
|
| 385 |
+
def temppath(
|
| 386 |
+
suffix: None | AnyStr = ...,
|
| 387 |
+
prefix: None | AnyStr = ...,
|
| 388 |
+
dir: None | AnyStr | os.PathLike[AnyStr] = ...,
|
| 389 |
+
text: bool = ...,
|
| 390 |
+
) -> contextlib._GeneratorContextManager[AnyStr]: ...
|
| 391 |
+
|
| 392 |
+
@overload
|
| 393 |
+
def assert_no_gc_cycles() -> contextlib._GeneratorContextManager[None]: ...
|
| 394 |
+
@overload
|
| 395 |
+
def assert_no_gc_cycles(
|
| 396 |
+
func: Callable[_P, Any],
|
| 397 |
+
/,
|
| 398 |
+
*args: _P.args,
|
| 399 |
+
**kwargs: _P.kwargs,
|
| 400 |
+
) -> None: ...
|
| 401 |
+
|
| 402 |
+
def break_cycles() -> None: ...
|
openflamingo/lib/python3.10/site-packages/numpy/typing/__init__.py
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
============================
|
| 3 |
+
Typing (:mod:`numpy.typing`)
|
| 4 |
+
============================
|
| 5 |
+
|
| 6 |
+
.. versionadded:: 1.20
|
| 7 |
+
|
| 8 |
+
Large parts of the NumPy API have :pep:`484`-style type annotations. In
|
| 9 |
+
addition a number of type aliases are available to users, most prominently
|
| 10 |
+
the two below:
|
| 11 |
+
|
| 12 |
+
- `ArrayLike`: objects that can be converted to arrays
|
| 13 |
+
- `DTypeLike`: objects that can be converted to dtypes
|
| 14 |
+
|
| 15 |
+
.. _typing-extensions: https://pypi.org/project/typing-extensions/
|
| 16 |
+
|
| 17 |
+
Mypy plugin
|
| 18 |
+
-----------
|
| 19 |
+
|
| 20 |
+
.. versionadded:: 1.21
|
| 21 |
+
|
| 22 |
+
.. automodule:: numpy.typing.mypy_plugin
|
| 23 |
+
|
| 24 |
+
.. currentmodule:: numpy.typing
|
| 25 |
+
|
| 26 |
+
Differences from the runtime NumPy API
|
| 27 |
+
--------------------------------------
|
| 28 |
+
|
| 29 |
+
NumPy is very flexible. Trying to describe the full range of
|
| 30 |
+
possibilities statically would result in types that are not very
|
| 31 |
+
helpful. For that reason, the typed NumPy API is often stricter than
|
| 32 |
+
the runtime NumPy API. This section describes some notable
|
| 33 |
+
differences.
|
| 34 |
+
|
| 35 |
+
ArrayLike
|
| 36 |
+
~~~~~~~~~
|
| 37 |
+
|
| 38 |
+
The `ArrayLike` type tries to avoid creating object arrays. For
|
| 39 |
+
example,
|
| 40 |
+
|
| 41 |
+
.. code-block:: python
|
| 42 |
+
|
| 43 |
+
>>> np.array(x**2 for x in range(10))
|
| 44 |
+
array(<generator object <genexpr> at ...>, dtype=object)
|
| 45 |
+
|
| 46 |
+
is valid NumPy code which will create a 0-dimensional object
|
| 47 |
+
array. Type checkers will complain about the above example when using
|
| 48 |
+
the NumPy types however. If you really intended to do the above, then
|
| 49 |
+
you can either use a ``# type: ignore`` comment:
|
| 50 |
+
|
| 51 |
+
.. code-block:: python
|
| 52 |
+
|
| 53 |
+
>>> np.array(x**2 for x in range(10)) # type: ignore
|
| 54 |
+
|
| 55 |
+
or explicitly type the array like object as `~typing.Any`:
|
| 56 |
+
|
| 57 |
+
.. code-block:: python
|
| 58 |
+
|
| 59 |
+
>>> from typing import Any
|
| 60 |
+
>>> array_like: Any = (x**2 for x in range(10))
|
| 61 |
+
>>> np.array(array_like)
|
| 62 |
+
array(<generator object <genexpr> at ...>, dtype=object)
|
| 63 |
+
|
| 64 |
+
ndarray
|
| 65 |
+
~~~~~~~
|
| 66 |
+
|
| 67 |
+
It's possible to mutate the dtype of an array at runtime. For example,
|
| 68 |
+
the following code is valid:
|
| 69 |
+
|
| 70 |
+
.. code-block:: python
|
| 71 |
+
|
| 72 |
+
>>> x = np.array([1, 2])
|
| 73 |
+
>>> x.dtype = np.bool_
|
| 74 |
+
|
| 75 |
+
This sort of mutation is not allowed by the types. Users who want to
|
| 76 |
+
write statically typed code should instead use the `numpy.ndarray.view`
|
| 77 |
+
method to create a view of the array with a different dtype.
|
| 78 |
+
|
| 79 |
+
DTypeLike
|
| 80 |
+
~~~~~~~~~
|
| 81 |
+
|
| 82 |
+
The `DTypeLike` type tries to avoid creation of dtype objects using
|
| 83 |
+
dictionary of fields like below:
|
| 84 |
+
|
| 85 |
+
.. code-block:: python
|
| 86 |
+
|
| 87 |
+
>>> x = np.dtype({"field1": (float, 1), "field2": (int, 3)})
|
| 88 |
+
|
| 89 |
+
Although this is valid NumPy code, the type checker will complain about it,
|
| 90 |
+
since its usage is discouraged.
|
| 91 |
+
Please see : :ref:`Data type objects <arrays.dtypes>`
|
| 92 |
+
|
| 93 |
+
Number precision
|
| 94 |
+
~~~~~~~~~~~~~~~~
|
| 95 |
+
|
| 96 |
+
The precision of `numpy.number` subclasses is treated as a covariant generic
|
| 97 |
+
parameter (see :class:`~NBitBase`), simplifying the annotating of processes
|
| 98 |
+
involving precision-based casting.
|
| 99 |
+
|
| 100 |
+
.. code-block:: python
|
| 101 |
+
|
| 102 |
+
>>> from typing import TypeVar
|
| 103 |
+
>>> import numpy as np
|
| 104 |
+
>>> import numpy.typing as npt
|
| 105 |
+
|
| 106 |
+
>>> T = TypeVar("T", bound=npt.NBitBase)
|
| 107 |
+
>>> def func(a: "np.floating[T]", b: "np.floating[T]") -> "np.floating[T]":
|
| 108 |
+
... ...
|
| 109 |
+
|
| 110 |
+
Consequently, the likes of `~numpy.float16`, `~numpy.float32` and
|
| 111 |
+
`~numpy.float64` are still sub-types of `~numpy.floating`, but, contrary to
|
| 112 |
+
runtime, they're not necessarily considered as sub-classes.
|
| 113 |
+
|
| 114 |
+
Timedelta64
|
| 115 |
+
~~~~~~~~~~~
|
| 116 |
+
|
| 117 |
+
The `~numpy.timedelta64` class is not considered a subclass of
|
| 118 |
+
`~numpy.signedinteger`, the former only inheriting from `~numpy.generic`
|
| 119 |
+
while static type checking.
|
| 120 |
+
|
| 121 |
+
0D arrays
|
| 122 |
+
~~~~~~~~~
|
| 123 |
+
|
| 124 |
+
During runtime numpy aggressively casts any passed 0D arrays into their
|
| 125 |
+
corresponding `~numpy.generic` instance. Until the introduction of shape
|
| 126 |
+
typing (see :pep:`646`) it is unfortunately not possible to make the
|
| 127 |
+
necessary distinction between 0D and >0D arrays. While thus not strictly
|
| 128 |
+
correct, all operations are that can potentially perform a 0D-array -> scalar
|
| 129 |
+
cast are currently annotated as exclusively returning an `ndarray`.
|
| 130 |
+
|
| 131 |
+
If it is known in advance that an operation _will_ perform a
|
| 132 |
+
0D-array -> scalar cast, then one can consider manually remedying the
|
| 133 |
+
situation with either `typing.cast` or a ``# type: ignore`` comment.
|
| 134 |
+
|
| 135 |
+
Record array dtypes
|
| 136 |
+
~~~~~~~~~~~~~~~~~~~
|
| 137 |
+
|
| 138 |
+
The dtype of `numpy.recarray`, and the `numpy.rec` functions in general,
|
| 139 |
+
can be specified in one of two ways:
|
| 140 |
+
|
| 141 |
+
* Directly via the ``dtype`` argument.
|
| 142 |
+
* With up to five helper arguments that operate via `numpy.format_parser`:
|
| 143 |
+
``formats``, ``names``, ``titles``, ``aligned`` and ``byteorder``.
|
| 144 |
+
|
| 145 |
+
These two approaches are currently typed as being mutually exclusive,
|
| 146 |
+
*i.e.* if ``dtype`` is specified than one may not specify ``formats``.
|
| 147 |
+
While this mutual exclusivity is not (strictly) enforced during runtime,
|
| 148 |
+
combining both dtype specifiers can lead to unexpected or even downright
|
| 149 |
+
buggy behavior.
|
| 150 |
+
|
| 151 |
+
API
|
| 152 |
+
---
|
| 153 |
+
|
| 154 |
+
"""
|
| 155 |
+
# NOTE: The API section will be appended with additional entries
|
| 156 |
+
# further down in this file
|
| 157 |
+
|
| 158 |
+
from numpy._typing import (
|
| 159 |
+
ArrayLike,
|
| 160 |
+
DTypeLike,
|
| 161 |
+
NBitBase,
|
| 162 |
+
NDArray,
|
| 163 |
+
)
|
| 164 |
+
|
| 165 |
+
__all__ = ["ArrayLike", "DTypeLike", "NBitBase", "NDArray"]
|
| 166 |
+
|
| 167 |
+
if __doc__ is not None:
|
| 168 |
+
from numpy._typing._add_docstring import _docstrings
|
| 169 |
+
__doc__ += _docstrings
|
| 170 |
+
__doc__ += '\n.. autoclass:: numpy.typing.NBitBase\n'
|
| 171 |
+
del _docstrings
|
| 172 |
+
|
| 173 |
+
from numpy._pytesttester import PytestTester
|
| 174 |
+
test = PytestTester(__name__)
|
| 175 |
+
del PytestTester
|
openflamingo/lib/python3.10/site-packages/numpy/typing/mypy_plugin.py
ADDED
|
@@ -0,0 +1,196 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""A mypy_ plugin for managing a number of platform-specific annotations.
|
| 2 |
+
Its functionality can be split into three distinct parts:
|
| 3 |
+
|
| 4 |
+
* Assigning the (platform-dependent) precisions of certain `~numpy.number`
|
| 5 |
+
subclasses, including the likes of `~numpy.int_`, `~numpy.intp` and
|
| 6 |
+
`~numpy.longlong`. See the documentation on
|
| 7 |
+
:ref:`scalar types <arrays.scalars.built-in>` for a comprehensive overview
|
| 8 |
+
of the affected classes. Without the plugin the precision of all relevant
|
| 9 |
+
classes will be inferred as `~typing.Any`.
|
| 10 |
+
* Removing all extended-precision `~numpy.number` subclasses that are
|
| 11 |
+
unavailable for the platform in question. Most notably this includes the
|
| 12 |
+
likes of `~numpy.float128` and `~numpy.complex256`. Without the plugin *all*
|
| 13 |
+
extended-precision types will, as far as mypy is concerned, be available
|
| 14 |
+
to all platforms.
|
| 15 |
+
* Assigning the (platform-dependent) precision of `~numpy.ctypeslib.c_intp`.
|
| 16 |
+
Without the plugin the type will default to `ctypes.c_int64`.
|
| 17 |
+
|
| 18 |
+
.. versionadded:: 1.22
|
| 19 |
+
|
| 20 |
+
Examples
|
| 21 |
+
--------
|
| 22 |
+
To enable the plugin, one must add it to their mypy `configuration file`_:
|
| 23 |
+
|
| 24 |
+
.. code-block:: ini
|
| 25 |
+
|
| 26 |
+
[mypy]
|
| 27 |
+
plugins = numpy.typing.mypy_plugin
|
| 28 |
+
|
| 29 |
+
.. _mypy: http://mypy-lang.org/
|
| 30 |
+
.. _configuration file: https://mypy.readthedocs.io/en/stable/config_file.html
|
| 31 |
+
|
| 32 |
+
"""
|
| 33 |
+
|
| 34 |
+
from __future__ import annotations
|
| 35 |
+
|
| 36 |
+
from collections.abc import Iterable
|
| 37 |
+
from typing import Final, TYPE_CHECKING, Callable
|
| 38 |
+
|
| 39 |
+
import numpy as np
|
| 40 |
+
|
| 41 |
+
try:
|
| 42 |
+
import mypy.types
|
| 43 |
+
from mypy.types import Type
|
| 44 |
+
from mypy.plugin import Plugin, AnalyzeTypeContext
|
| 45 |
+
from mypy.nodes import MypyFile, ImportFrom, Statement
|
| 46 |
+
from mypy.build import PRI_MED
|
| 47 |
+
|
| 48 |
+
_HookFunc = Callable[[AnalyzeTypeContext], Type]
|
| 49 |
+
MYPY_EX: None | ModuleNotFoundError = None
|
| 50 |
+
except ModuleNotFoundError as ex:
|
| 51 |
+
MYPY_EX = ex
|
| 52 |
+
|
| 53 |
+
__all__: list[str] = []
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _get_precision_dict() -> dict[str, str]:
|
| 57 |
+
names = [
|
| 58 |
+
("_NBitByte", np.byte),
|
| 59 |
+
("_NBitShort", np.short),
|
| 60 |
+
("_NBitIntC", np.intc),
|
| 61 |
+
("_NBitIntP", np.intp),
|
| 62 |
+
("_NBitInt", np.int_),
|
| 63 |
+
("_NBitLongLong", np.longlong),
|
| 64 |
+
|
| 65 |
+
("_NBitHalf", np.half),
|
| 66 |
+
("_NBitSingle", np.single),
|
| 67 |
+
("_NBitDouble", np.double),
|
| 68 |
+
("_NBitLongDouble", np.longdouble),
|
| 69 |
+
]
|
| 70 |
+
ret = {}
|
| 71 |
+
for name, typ in names:
|
| 72 |
+
n: int = 8 * typ().dtype.itemsize
|
| 73 |
+
ret[f'numpy._typing._nbit.{name}'] = f"numpy._{n}Bit"
|
| 74 |
+
return ret
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _get_extended_precision_list() -> list[str]:
|
| 78 |
+
extended_names = [
|
| 79 |
+
"uint128",
|
| 80 |
+
"uint256",
|
| 81 |
+
"int128",
|
| 82 |
+
"int256",
|
| 83 |
+
"float80",
|
| 84 |
+
"float96",
|
| 85 |
+
"float128",
|
| 86 |
+
"float256",
|
| 87 |
+
"complex160",
|
| 88 |
+
"complex192",
|
| 89 |
+
"complex256",
|
| 90 |
+
"complex512",
|
| 91 |
+
]
|
| 92 |
+
return [i for i in extended_names if hasattr(np, i)]
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
def _get_c_intp_name() -> str:
|
| 96 |
+
# Adapted from `np.core._internal._getintp_ctype`
|
| 97 |
+
char = np.dtype('p').char
|
| 98 |
+
if char == 'i':
|
| 99 |
+
return "c_int"
|
| 100 |
+
elif char == 'l':
|
| 101 |
+
return "c_long"
|
| 102 |
+
elif char == 'q':
|
| 103 |
+
return "c_longlong"
|
| 104 |
+
else:
|
| 105 |
+
return "c_long"
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
#: A dictionary mapping type-aliases in `numpy._typing._nbit` to
|
| 109 |
+
#: concrete `numpy.typing.NBitBase` subclasses.
|
| 110 |
+
_PRECISION_DICT: Final = _get_precision_dict()
|
| 111 |
+
|
| 112 |
+
#: A list with the names of all extended precision `np.number` subclasses.
|
| 113 |
+
_EXTENDED_PRECISION_LIST: Final = _get_extended_precision_list()
|
| 114 |
+
|
| 115 |
+
#: The name of the ctypes quivalent of `np.intp`
|
| 116 |
+
_C_INTP: Final = _get_c_intp_name()
|
| 117 |
+
|
| 118 |
+
|
| 119 |
+
def _hook(ctx: AnalyzeTypeContext) -> Type:
|
| 120 |
+
"""Replace a type-alias with a concrete ``NBitBase`` subclass."""
|
| 121 |
+
typ, _, api = ctx
|
| 122 |
+
name = typ.name.split(".")[-1]
|
| 123 |
+
name_new = _PRECISION_DICT[f"numpy._typing._nbit.{name}"]
|
| 124 |
+
return api.named_type(name_new)
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
if TYPE_CHECKING or MYPY_EX is None:
|
| 128 |
+
def _index(iterable: Iterable[Statement], id: str) -> int:
|
| 129 |
+
"""Identify the first ``ImportFrom`` instance the specified `id`."""
|
| 130 |
+
for i, value in enumerate(iterable):
|
| 131 |
+
if getattr(value, "id", None) == id:
|
| 132 |
+
return i
|
| 133 |
+
raise ValueError("Failed to identify a `ImportFrom` instance "
|
| 134 |
+
f"with the following id: {id!r}")
|
| 135 |
+
|
| 136 |
+
def _override_imports(
|
| 137 |
+
file: MypyFile,
|
| 138 |
+
module: str,
|
| 139 |
+
imports: list[tuple[str, None | str]],
|
| 140 |
+
) -> None:
|
| 141 |
+
"""Override the first `module`-based import with new `imports`."""
|
| 142 |
+
# Construct a new `from module import y` statement
|
| 143 |
+
import_obj = ImportFrom(module, 0, names=imports)
|
| 144 |
+
import_obj.is_top_level = True
|
| 145 |
+
|
| 146 |
+
# Replace the first `module`-based import statement with `import_obj`
|
| 147 |
+
for lst in [file.defs, file.imports]: # type: list[Statement]
|
| 148 |
+
i = _index(lst, module)
|
| 149 |
+
lst[i] = import_obj
|
| 150 |
+
|
| 151 |
+
class _NumpyPlugin(Plugin):
|
| 152 |
+
"""A mypy plugin for handling versus numpy-specific typing tasks."""
|
| 153 |
+
|
| 154 |
+
def get_type_analyze_hook(self, fullname: str) -> None | _HookFunc:
|
| 155 |
+
"""Set the precision of platform-specific `numpy.number`
|
| 156 |
+
subclasses.
|
| 157 |
+
|
| 158 |
+
For example: `numpy.int_`, `numpy.longlong` and `numpy.longdouble`.
|
| 159 |
+
"""
|
| 160 |
+
if fullname in _PRECISION_DICT:
|
| 161 |
+
return _hook
|
| 162 |
+
return None
|
| 163 |
+
|
| 164 |
+
def get_additional_deps(
|
| 165 |
+
self, file: MypyFile
|
| 166 |
+
) -> list[tuple[int, str, int]]:
|
| 167 |
+
"""Handle all import-based overrides.
|
| 168 |
+
|
| 169 |
+
* Import platform-specific extended-precision `numpy.number`
|
| 170 |
+
subclasses (*e.g.* `numpy.float96`, `numpy.float128` and
|
| 171 |
+
`numpy.complex256`).
|
| 172 |
+
* Import the appropriate `ctypes` equivalent to `numpy.intp`.
|
| 173 |
+
|
| 174 |
+
"""
|
| 175 |
+
ret = [(PRI_MED, file.fullname, -1)]
|
| 176 |
+
|
| 177 |
+
if file.fullname == "numpy":
|
| 178 |
+
_override_imports(
|
| 179 |
+
file, "numpy._typing._extended_precision",
|
| 180 |
+
imports=[(v, v) for v in _EXTENDED_PRECISION_LIST],
|
| 181 |
+
)
|
| 182 |
+
elif file.fullname == "numpy.ctypeslib":
|
| 183 |
+
_override_imports(
|
| 184 |
+
file, "ctypes",
|
| 185 |
+
imports=[(_C_INTP, "_c_intp")],
|
| 186 |
+
)
|
| 187 |
+
return ret
|
| 188 |
+
|
| 189 |
+
def plugin(version: str) -> type[_NumpyPlugin]:
|
| 190 |
+
"""An entry-point for mypy."""
|
| 191 |
+
return _NumpyPlugin
|
| 192 |
+
|
| 193 |
+
else:
|
| 194 |
+
def plugin(version: str) -> type[_NumpyPlugin]:
|
| 195 |
+
"""An entry-point for mypy."""
|
| 196 |
+
raise MYPY_EX
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_isfile.cpython-310.pyc
ADDED
|
Binary file (1.09 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_runtime.cpython-310.pyc
ADDED
|
Binary file (3.65 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/__pycache__/test_typing.cpython-310.pyc
ADDED
|
Binary file (7.36 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/array_pad.pyi
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
AR_i8: npt.NDArray[np.int64]
|
| 5 |
+
|
| 6 |
+
np.pad(AR_i8, 2, mode="bob") # E: No overload variant
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/comparisons.pyi
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any
|
| 2 |
+
import numpy as np
|
| 3 |
+
|
| 4 |
+
AR_i: np.ndarray[Any, np.dtype[np.int64]]
|
| 5 |
+
AR_f: np.ndarray[Any, np.dtype[np.float64]]
|
| 6 |
+
AR_c: np.ndarray[Any, np.dtype[np.complex128]]
|
| 7 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]]
|
| 8 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]]
|
| 9 |
+
|
| 10 |
+
AR_f > AR_m # E: Unsupported operand types
|
| 11 |
+
AR_c > AR_m # E: Unsupported operand types
|
| 12 |
+
|
| 13 |
+
AR_m > AR_f # E: Unsupported operand types
|
| 14 |
+
AR_m > AR_c # E: Unsupported operand types
|
| 15 |
+
|
| 16 |
+
AR_i > AR_M # E: Unsupported operand types
|
| 17 |
+
AR_f > AR_M # E: Unsupported operand types
|
| 18 |
+
AR_m > AR_M # E: Unsupported operand types
|
| 19 |
+
|
| 20 |
+
AR_M > AR_i # E: Unsupported operand types
|
| 21 |
+
AR_M > AR_f # E: Unsupported operand types
|
| 22 |
+
AR_M > AR_m # E: Unsupported operand types
|
| 23 |
+
|
| 24 |
+
AR_i > str() # E: No overload variant
|
| 25 |
+
AR_i > bytes() # E: No overload variant
|
| 26 |
+
str() > AR_M # E: Unsupported operand types
|
| 27 |
+
bytes() > AR_M # E: Unsupported operand types
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/fail/multiarray.pyi
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
import numpy.typing as npt
|
| 3 |
+
|
| 4 |
+
i8: np.int64
|
| 5 |
+
|
| 6 |
+
AR_b: npt.NDArray[np.bool_]
|
| 7 |
+
AR_u1: npt.NDArray[np.uint8]
|
| 8 |
+
AR_i8: npt.NDArray[np.int64]
|
| 9 |
+
AR_f8: npt.NDArray[np.float64]
|
| 10 |
+
AR_M: npt.NDArray[np.datetime64]
|
| 11 |
+
|
| 12 |
+
M: np.datetime64
|
| 13 |
+
|
| 14 |
+
AR_LIKE_f: list[float]
|
| 15 |
+
|
| 16 |
+
def func(a: int) -> None: ...
|
| 17 |
+
|
| 18 |
+
np.where(AR_b, 1) # E: No overload variant
|
| 19 |
+
|
| 20 |
+
np.can_cast(AR_f8, 1) # E: incompatible type
|
| 21 |
+
|
| 22 |
+
np.vdot(AR_M, AR_M) # E: incompatible type
|
| 23 |
+
|
| 24 |
+
np.copyto(AR_LIKE_f, AR_f8) # E: incompatible type
|
| 25 |
+
|
| 26 |
+
np.putmask(AR_LIKE_f, [True, True, False], 1.5) # E: incompatible type
|
| 27 |
+
|
| 28 |
+
np.packbits(AR_f8) # E: incompatible type
|
| 29 |
+
np.packbits(AR_u1, bitorder=">") # E: incompatible type
|
| 30 |
+
|
| 31 |
+
np.unpackbits(AR_i8) # E: incompatible type
|
| 32 |
+
np.unpackbits(AR_u1, bitorder=">") # E: incompatible type
|
| 33 |
+
|
| 34 |
+
np.shares_memory(1, 1, max_work=i8) # E: incompatible type
|
| 35 |
+
np.may_share_memory(1, 1, max_work=i8) # E: incompatible type
|
| 36 |
+
|
| 37 |
+
np.arange(M) # E: No overload variant
|
| 38 |
+
np.arange(stop=10) # E: No overload variant
|
| 39 |
+
|
| 40 |
+
np.datetime_data(int) # E: incompatible type
|
| 41 |
+
|
| 42 |
+
np.busday_offset("2012", 10) # E: No overload variant
|
| 43 |
+
|
| 44 |
+
np.datetime_as_string("2012") # E: No overload variant
|
| 45 |
+
|
| 46 |
+
np.compare_chararrays("a", b"a", "==", False) # E: No overload variant
|
| 47 |
+
|
| 48 |
+
np.add_docstring(func, None) # E: incompatible type
|
| 49 |
+
|
| 50 |
+
np.nested_iters([AR_i8, AR_i8]) # E: Missing positional argument
|
| 51 |
+
np.nested_iters([AR_i8, AR_i8], 0) # E: incompatible type
|
| 52 |
+
np.nested_iters([AR_i8, AR_i8], [0]) # E: incompatible type
|
| 53 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], flags=["test"]) # E: incompatible type
|
| 54 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], op_flags=[["test"]]) # E: incompatible type
|
| 55 |
+
np.nested_iters([AR_i8, AR_i8], [[0], [1]], buffersize=1.0) # E: incompatible type
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arithmetic.cpython-310.pyc
ADDED
|
Binary file (7.21 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/array_like.cpython-310.pyc
ADDED
|
Binary file (1.54 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayprint.cpython-310.pyc
ADDED
|
Binary file (919 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/arrayterator.cpython-310.pyc
ADDED
|
Binary file (656 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/bitwise_ops.cpython-310.pyc
ADDED
|
Binary file (1.41 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/flatiter.cpython-310.pyc
ADDED
|
Binary file (465 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/fromnumeric.cpython-310.pyc
ADDED
|
Binary file (3.74 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/modules.cpython-310.pyc
ADDED
|
Binary file (790 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_conversion.cpython-310.pyc
ADDED
|
Binary file (1.46 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ndarray_shape_manipulation.cpython-310.pyc
ADDED
|
Binary file (760 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/random.cpython-310.pyc
ADDED
|
Binary file (26.7 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple.cpython-310.pyc
ADDED
|
Binary file (2.39 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/simple_py3.cpython-310.pyc
ADDED
|
Binary file (252 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunc_config.cpython-310.pyc
ADDED
|
Binary file (2.22 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufunclike.cpython-310.pyc
ADDED
|
Binary file (1.64 kB). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/ufuncs.cpython-310.pyc
ADDED
|
Binary file (649 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/__pycache__/warnings_and_errors.cpython-310.pyc
ADDED
|
Binary file (343 Bytes). View file
|
|
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/array_constructors.py
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
from typing import Any
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
class Index:
|
| 7 |
+
def __index__(self) -> int:
|
| 8 |
+
return 0
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class SubClass(np.ndarray):
|
| 12 |
+
pass
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def func(i: int, j: int, **kwargs: Any) -> SubClass:
|
| 16 |
+
return B
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
i8 = np.int64(1)
|
| 20 |
+
|
| 21 |
+
A = np.array([1])
|
| 22 |
+
B = A.view(SubClass).copy()
|
| 23 |
+
B_stack = np.array([[1], [1]]).view(SubClass)
|
| 24 |
+
C = [1]
|
| 25 |
+
|
| 26 |
+
np.ndarray(Index())
|
| 27 |
+
np.ndarray([Index()])
|
| 28 |
+
|
| 29 |
+
np.array(1, dtype=float)
|
| 30 |
+
np.array(1, copy=False)
|
| 31 |
+
np.array(1, order='F')
|
| 32 |
+
np.array(1, order=None)
|
| 33 |
+
np.array(1, subok=True)
|
| 34 |
+
np.array(1, ndmin=3)
|
| 35 |
+
np.array(1, str, copy=True, order='C', subok=False, ndmin=2)
|
| 36 |
+
|
| 37 |
+
np.asarray(A)
|
| 38 |
+
np.asarray(B)
|
| 39 |
+
np.asarray(C)
|
| 40 |
+
|
| 41 |
+
np.asanyarray(A)
|
| 42 |
+
np.asanyarray(B)
|
| 43 |
+
np.asanyarray(B, dtype=int)
|
| 44 |
+
np.asanyarray(C)
|
| 45 |
+
|
| 46 |
+
np.ascontiguousarray(A)
|
| 47 |
+
np.ascontiguousarray(B)
|
| 48 |
+
np.ascontiguousarray(C)
|
| 49 |
+
|
| 50 |
+
np.asfortranarray(A)
|
| 51 |
+
np.asfortranarray(B)
|
| 52 |
+
np.asfortranarray(C)
|
| 53 |
+
|
| 54 |
+
np.require(A)
|
| 55 |
+
np.require(B)
|
| 56 |
+
np.require(B, dtype=int)
|
| 57 |
+
np.require(B, requirements=None)
|
| 58 |
+
np.require(B, requirements="E")
|
| 59 |
+
np.require(B, requirements=["ENSUREARRAY"])
|
| 60 |
+
np.require(B, requirements={"F", "E"})
|
| 61 |
+
np.require(B, requirements=["C", "OWNDATA"])
|
| 62 |
+
np.require(B, requirements="W")
|
| 63 |
+
np.require(B, requirements="A")
|
| 64 |
+
np.require(C)
|
| 65 |
+
|
| 66 |
+
np.linspace(0, 2)
|
| 67 |
+
np.linspace(0.5, [0, 1, 2])
|
| 68 |
+
np.linspace([0, 1, 2], 3)
|
| 69 |
+
np.linspace(0j, 2)
|
| 70 |
+
np.linspace(0, 2, num=10)
|
| 71 |
+
np.linspace(0, 2, endpoint=True)
|
| 72 |
+
np.linspace(0, 2, retstep=True)
|
| 73 |
+
np.linspace(0j, 2j, retstep=True)
|
| 74 |
+
np.linspace(0, 2, dtype=bool)
|
| 75 |
+
np.linspace([0, 1], [2, 3], axis=Index())
|
| 76 |
+
|
| 77 |
+
np.logspace(0, 2, base=2)
|
| 78 |
+
np.logspace(0, 2, base=2)
|
| 79 |
+
np.logspace(0, 2, base=[1j, 2j], num=2)
|
| 80 |
+
|
| 81 |
+
np.geomspace(1, 2)
|
| 82 |
+
|
| 83 |
+
np.zeros_like(A)
|
| 84 |
+
np.zeros_like(C)
|
| 85 |
+
np.zeros_like(B)
|
| 86 |
+
np.zeros_like(B, dtype=np.int64)
|
| 87 |
+
|
| 88 |
+
np.ones_like(A)
|
| 89 |
+
np.ones_like(C)
|
| 90 |
+
np.ones_like(B)
|
| 91 |
+
np.ones_like(B, dtype=np.int64)
|
| 92 |
+
|
| 93 |
+
np.empty_like(A)
|
| 94 |
+
np.empty_like(C)
|
| 95 |
+
np.empty_like(B)
|
| 96 |
+
np.empty_like(B, dtype=np.int64)
|
| 97 |
+
|
| 98 |
+
np.full_like(A, i8)
|
| 99 |
+
np.full_like(C, i8)
|
| 100 |
+
np.full_like(B, i8)
|
| 101 |
+
np.full_like(B, i8, dtype=np.int64)
|
| 102 |
+
|
| 103 |
+
np.ones(1)
|
| 104 |
+
np.ones([1, 1, 1])
|
| 105 |
+
|
| 106 |
+
np.full(1, i8)
|
| 107 |
+
np.full([1, 1, 1], i8)
|
| 108 |
+
|
| 109 |
+
np.indices([1, 2, 3])
|
| 110 |
+
np.indices([1, 2, 3], sparse=True)
|
| 111 |
+
|
| 112 |
+
np.fromfunction(func, (3, 5))
|
| 113 |
+
|
| 114 |
+
np.identity(10)
|
| 115 |
+
|
| 116 |
+
np.atleast_1d(C)
|
| 117 |
+
np.atleast_1d(A)
|
| 118 |
+
np.atleast_1d(C, C)
|
| 119 |
+
np.atleast_1d(C, A)
|
| 120 |
+
np.atleast_1d(A, A)
|
| 121 |
+
|
| 122 |
+
np.atleast_2d(C)
|
| 123 |
+
|
| 124 |
+
np.atleast_3d(C)
|
| 125 |
+
|
| 126 |
+
np.vstack([C, C])
|
| 127 |
+
np.vstack([C, A])
|
| 128 |
+
np.vstack([A, A])
|
| 129 |
+
|
| 130 |
+
np.hstack([C, C])
|
| 131 |
+
|
| 132 |
+
np.stack([C, C])
|
| 133 |
+
np.stack([C, C], axis=0)
|
| 134 |
+
np.stack([C, C], out=B_stack)
|
| 135 |
+
|
| 136 |
+
np.block([[C, C], [C, C]])
|
| 137 |
+
np.block(A)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/comparisons.py
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import Any
|
| 4 |
+
import numpy as np
|
| 5 |
+
|
| 6 |
+
c16 = np.complex128()
|
| 7 |
+
f8 = np.float64()
|
| 8 |
+
i8 = np.int64()
|
| 9 |
+
u8 = np.uint64()
|
| 10 |
+
|
| 11 |
+
c8 = np.complex64()
|
| 12 |
+
f4 = np.float32()
|
| 13 |
+
i4 = np.int32()
|
| 14 |
+
u4 = np.uint32()
|
| 15 |
+
|
| 16 |
+
dt = np.datetime64(0, "D")
|
| 17 |
+
td = np.timedelta64(0, "D")
|
| 18 |
+
|
| 19 |
+
b_ = np.bool_()
|
| 20 |
+
|
| 21 |
+
b = bool()
|
| 22 |
+
c = complex()
|
| 23 |
+
f = float()
|
| 24 |
+
i = int()
|
| 25 |
+
|
| 26 |
+
SEQ = (0, 1, 2, 3, 4)
|
| 27 |
+
|
| 28 |
+
AR_b: np.ndarray[Any, np.dtype[np.bool_]] = np.array([True])
|
| 29 |
+
AR_u: np.ndarray[Any, np.dtype[np.uint32]] = np.array([1], dtype=np.uint32)
|
| 30 |
+
AR_i: np.ndarray[Any, np.dtype[np.int_]] = np.array([1])
|
| 31 |
+
AR_f: np.ndarray[Any, np.dtype[np.float_]] = np.array([1.0])
|
| 32 |
+
AR_c: np.ndarray[Any, np.dtype[np.complex_]] = np.array([1.0j])
|
| 33 |
+
AR_m: np.ndarray[Any, np.dtype[np.timedelta64]] = np.array([np.timedelta64("1")])
|
| 34 |
+
AR_M: np.ndarray[Any, np.dtype[np.datetime64]] = np.array([np.datetime64("1")])
|
| 35 |
+
AR_O: np.ndarray[Any, np.dtype[np.object_]] = np.array([1], dtype=object)
|
| 36 |
+
|
| 37 |
+
# Arrays
|
| 38 |
+
|
| 39 |
+
AR_b > AR_b
|
| 40 |
+
AR_b > AR_u
|
| 41 |
+
AR_b > AR_i
|
| 42 |
+
AR_b > AR_f
|
| 43 |
+
AR_b > AR_c
|
| 44 |
+
|
| 45 |
+
AR_u > AR_b
|
| 46 |
+
AR_u > AR_u
|
| 47 |
+
AR_u > AR_i
|
| 48 |
+
AR_u > AR_f
|
| 49 |
+
AR_u > AR_c
|
| 50 |
+
|
| 51 |
+
AR_i > AR_b
|
| 52 |
+
AR_i > AR_u
|
| 53 |
+
AR_i > AR_i
|
| 54 |
+
AR_i > AR_f
|
| 55 |
+
AR_i > AR_c
|
| 56 |
+
|
| 57 |
+
AR_f > AR_b
|
| 58 |
+
AR_f > AR_u
|
| 59 |
+
AR_f > AR_i
|
| 60 |
+
AR_f > AR_f
|
| 61 |
+
AR_f > AR_c
|
| 62 |
+
|
| 63 |
+
AR_c > AR_b
|
| 64 |
+
AR_c > AR_u
|
| 65 |
+
AR_c > AR_i
|
| 66 |
+
AR_c > AR_f
|
| 67 |
+
AR_c > AR_c
|
| 68 |
+
|
| 69 |
+
AR_m > AR_b
|
| 70 |
+
AR_m > AR_u
|
| 71 |
+
AR_m > AR_i
|
| 72 |
+
AR_b > AR_m
|
| 73 |
+
AR_u > AR_m
|
| 74 |
+
AR_i > AR_m
|
| 75 |
+
|
| 76 |
+
AR_M > AR_M
|
| 77 |
+
|
| 78 |
+
AR_O > AR_O
|
| 79 |
+
1 > AR_O
|
| 80 |
+
AR_O > 1
|
| 81 |
+
|
| 82 |
+
# Time structures
|
| 83 |
+
|
| 84 |
+
dt > dt
|
| 85 |
+
|
| 86 |
+
td > td
|
| 87 |
+
td > i
|
| 88 |
+
td > i4
|
| 89 |
+
td > i8
|
| 90 |
+
td > AR_i
|
| 91 |
+
td > SEQ
|
| 92 |
+
|
| 93 |
+
# boolean
|
| 94 |
+
|
| 95 |
+
b_ > b
|
| 96 |
+
b_ > b_
|
| 97 |
+
b_ > i
|
| 98 |
+
b_ > i8
|
| 99 |
+
b_ > i4
|
| 100 |
+
b_ > u8
|
| 101 |
+
b_ > u4
|
| 102 |
+
b_ > f
|
| 103 |
+
b_ > f8
|
| 104 |
+
b_ > f4
|
| 105 |
+
b_ > c
|
| 106 |
+
b_ > c16
|
| 107 |
+
b_ > c8
|
| 108 |
+
b_ > AR_i
|
| 109 |
+
b_ > SEQ
|
| 110 |
+
|
| 111 |
+
# Complex
|
| 112 |
+
|
| 113 |
+
c16 > c16
|
| 114 |
+
c16 > f8
|
| 115 |
+
c16 > i8
|
| 116 |
+
c16 > c8
|
| 117 |
+
c16 > f4
|
| 118 |
+
c16 > i4
|
| 119 |
+
c16 > b_
|
| 120 |
+
c16 > b
|
| 121 |
+
c16 > c
|
| 122 |
+
c16 > f
|
| 123 |
+
c16 > i
|
| 124 |
+
c16 > AR_i
|
| 125 |
+
c16 > SEQ
|
| 126 |
+
|
| 127 |
+
c16 > c16
|
| 128 |
+
f8 > c16
|
| 129 |
+
i8 > c16
|
| 130 |
+
c8 > c16
|
| 131 |
+
f4 > c16
|
| 132 |
+
i4 > c16
|
| 133 |
+
b_ > c16
|
| 134 |
+
b > c16
|
| 135 |
+
c > c16
|
| 136 |
+
f > c16
|
| 137 |
+
i > c16
|
| 138 |
+
AR_i > c16
|
| 139 |
+
SEQ > c16
|
| 140 |
+
|
| 141 |
+
c8 > c16
|
| 142 |
+
c8 > f8
|
| 143 |
+
c8 > i8
|
| 144 |
+
c8 > c8
|
| 145 |
+
c8 > f4
|
| 146 |
+
c8 > i4
|
| 147 |
+
c8 > b_
|
| 148 |
+
c8 > b
|
| 149 |
+
c8 > c
|
| 150 |
+
c8 > f
|
| 151 |
+
c8 > i
|
| 152 |
+
c8 > AR_i
|
| 153 |
+
c8 > SEQ
|
| 154 |
+
|
| 155 |
+
c16 > c8
|
| 156 |
+
f8 > c8
|
| 157 |
+
i8 > c8
|
| 158 |
+
c8 > c8
|
| 159 |
+
f4 > c8
|
| 160 |
+
i4 > c8
|
| 161 |
+
b_ > c8
|
| 162 |
+
b > c8
|
| 163 |
+
c > c8
|
| 164 |
+
f > c8
|
| 165 |
+
i > c8
|
| 166 |
+
AR_i > c8
|
| 167 |
+
SEQ > c8
|
| 168 |
+
|
| 169 |
+
# Float
|
| 170 |
+
|
| 171 |
+
f8 > f8
|
| 172 |
+
f8 > i8
|
| 173 |
+
f8 > f4
|
| 174 |
+
f8 > i4
|
| 175 |
+
f8 > b_
|
| 176 |
+
f8 > b
|
| 177 |
+
f8 > c
|
| 178 |
+
f8 > f
|
| 179 |
+
f8 > i
|
| 180 |
+
f8 > AR_i
|
| 181 |
+
f8 > SEQ
|
| 182 |
+
|
| 183 |
+
f8 > f8
|
| 184 |
+
i8 > f8
|
| 185 |
+
f4 > f8
|
| 186 |
+
i4 > f8
|
| 187 |
+
b_ > f8
|
| 188 |
+
b > f8
|
| 189 |
+
c > f8
|
| 190 |
+
f > f8
|
| 191 |
+
i > f8
|
| 192 |
+
AR_i > f8
|
| 193 |
+
SEQ > f8
|
| 194 |
+
|
| 195 |
+
f4 > f8
|
| 196 |
+
f4 > i8
|
| 197 |
+
f4 > f4
|
| 198 |
+
f4 > i4
|
| 199 |
+
f4 > b_
|
| 200 |
+
f4 > b
|
| 201 |
+
f4 > c
|
| 202 |
+
f4 > f
|
| 203 |
+
f4 > i
|
| 204 |
+
f4 > AR_i
|
| 205 |
+
f4 > SEQ
|
| 206 |
+
|
| 207 |
+
f8 > f4
|
| 208 |
+
i8 > f4
|
| 209 |
+
f4 > f4
|
| 210 |
+
i4 > f4
|
| 211 |
+
b_ > f4
|
| 212 |
+
b > f4
|
| 213 |
+
c > f4
|
| 214 |
+
f > f4
|
| 215 |
+
i > f4
|
| 216 |
+
AR_i > f4
|
| 217 |
+
SEQ > f4
|
| 218 |
+
|
| 219 |
+
# Int
|
| 220 |
+
|
| 221 |
+
i8 > i8
|
| 222 |
+
i8 > u8
|
| 223 |
+
i8 > i4
|
| 224 |
+
i8 > u4
|
| 225 |
+
i8 > b_
|
| 226 |
+
i8 > b
|
| 227 |
+
i8 > c
|
| 228 |
+
i8 > f
|
| 229 |
+
i8 > i
|
| 230 |
+
i8 > AR_i
|
| 231 |
+
i8 > SEQ
|
| 232 |
+
|
| 233 |
+
u8 > u8
|
| 234 |
+
u8 > i4
|
| 235 |
+
u8 > u4
|
| 236 |
+
u8 > b_
|
| 237 |
+
u8 > b
|
| 238 |
+
u8 > c
|
| 239 |
+
u8 > f
|
| 240 |
+
u8 > i
|
| 241 |
+
u8 > AR_i
|
| 242 |
+
u8 > SEQ
|
| 243 |
+
|
| 244 |
+
i8 > i8
|
| 245 |
+
u8 > i8
|
| 246 |
+
i4 > i8
|
| 247 |
+
u4 > i8
|
| 248 |
+
b_ > i8
|
| 249 |
+
b > i8
|
| 250 |
+
c > i8
|
| 251 |
+
f > i8
|
| 252 |
+
i > i8
|
| 253 |
+
AR_i > i8
|
| 254 |
+
SEQ > i8
|
| 255 |
+
|
| 256 |
+
u8 > u8
|
| 257 |
+
i4 > u8
|
| 258 |
+
u4 > u8
|
| 259 |
+
b_ > u8
|
| 260 |
+
b > u8
|
| 261 |
+
c > u8
|
| 262 |
+
f > u8
|
| 263 |
+
i > u8
|
| 264 |
+
AR_i > u8
|
| 265 |
+
SEQ > u8
|
| 266 |
+
|
| 267 |
+
i4 > i8
|
| 268 |
+
i4 > i4
|
| 269 |
+
i4 > i
|
| 270 |
+
i4 > b_
|
| 271 |
+
i4 > b
|
| 272 |
+
i4 > AR_i
|
| 273 |
+
i4 > SEQ
|
| 274 |
+
|
| 275 |
+
u4 > i8
|
| 276 |
+
u4 > i4
|
| 277 |
+
u4 > u8
|
| 278 |
+
u4 > u4
|
| 279 |
+
u4 > i
|
| 280 |
+
u4 > b_
|
| 281 |
+
u4 > b
|
| 282 |
+
u4 > AR_i
|
| 283 |
+
u4 > SEQ
|
| 284 |
+
|
| 285 |
+
i8 > i4
|
| 286 |
+
i4 > i4
|
| 287 |
+
i > i4
|
| 288 |
+
b_ > i4
|
| 289 |
+
b > i4
|
| 290 |
+
AR_i > i4
|
| 291 |
+
SEQ > i4
|
| 292 |
+
|
| 293 |
+
i8 > u4
|
| 294 |
+
i4 > u4
|
| 295 |
+
u8 > u4
|
| 296 |
+
u4 > u4
|
| 297 |
+
b_ > u4
|
| 298 |
+
b > u4
|
| 299 |
+
i > u4
|
| 300 |
+
AR_i > u4
|
| 301 |
+
SEQ > u4
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/einsumfunc.py
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import Any
|
| 4 |
+
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
AR_LIKE_b = [True, True, True]
|
| 8 |
+
AR_LIKE_u = [np.uint32(1), np.uint32(2), np.uint32(3)]
|
| 9 |
+
AR_LIKE_i = [1, 2, 3]
|
| 10 |
+
AR_LIKE_f = [1.0, 2.0, 3.0]
|
| 11 |
+
AR_LIKE_c = [1j, 2j, 3j]
|
| 12 |
+
AR_LIKE_U = ["1", "2", "3"]
|
| 13 |
+
|
| 14 |
+
OUT_f: np.ndarray[Any, np.dtype[np.float64]] = np.empty(3, dtype=np.float64)
|
| 15 |
+
OUT_c: np.ndarray[Any, np.dtype[np.complex128]] = np.empty(3, dtype=np.complex128)
|
| 16 |
+
|
| 17 |
+
np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_b)
|
| 18 |
+
np.einsum("i,i->i", AR_LIKE_u, AR_LIKE_u)
|
| 19 |
+
np.einsum("i,i->i", AR_LIKE_i, AR_LIKE_i)
|
| 20 |
+
np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f)
|
| 21 |
+
np.einsum("i,i->i", AR_LIKE_c, AR_LIKE_c)
|
| 22 |
+
np.einsum("i,i->i", AR_LIKE_b, AR_LIKE_i)
|
| 23 |
+
np.einsum("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)
|
| 24 |
+
|
| 25 |
+
np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, dtype="c16")
|
| 26 |
+
np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=bool, casting="unsafe")
|
| 27 |
+
np.einsum("i,i->i", AR_LIKE_f, AR_LIKE_f, out=OUT_c)
|
| 28 |
+
np.einsum("i,i->i", AR_LIKE_U, AR_LIKE_U, dtype=int, casting="unsafe", out=OUT_f)
|
| 29 |
+
|
| 30 |
+
np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_b)
|
| 31 |
+
np.einsum_path("i,i->i", AR_LIKE_u, AR_LIKE_u)
|
| 32 |
+
np.einsum_path("i,i->i", AR_LIKE_i, AR_LIKE_i)
|
| 33 |
+
np.einsum_path("i,i->i", AR_LIKE_f, AR_LIKE_f)
|
| 34 |
+
np.einsum_path("i,i->i", AR_LIKE_c, AR_LIKE_c)
|
| 35 |
+
np.einsum_path("i,i->i", AR_LIKE_b, AR_LIKE_i)
|
| 36 |
+
np.einsum_path("i,i,i,i->i", AR_LIKE_b, AR_LIKE_u, AR_LIKE_i, AR_LIKE_c)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/fromnumeric.py
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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Tests for :mod:`numpy.core.fromnumeric`."""
|
| 2 |
+
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
A = np.array(True, ndmin=2, dtype=bool)
|
| 6 |
+
B = np.array(1.0, ndmin=2, dtype=np.float32)
|
| 7 |
+
A.setflags(write=False)
|
| 8 |
+
B.setflags(write=False)
|
| 9 |
+
|
| 10 |
+
a = np.bool_(True)
|
| 11 |
+
b = np.float32(1.0)
|
| 12 |
+
c = 1.0
|
| 13 |
+
d = np.array(1.0, dtype=np.float32) # writeable
|
| 14 |
+
|
| 15 |
+
np.take(a, 0)
|
| 16 |
+
np.take(b, 0)
|
| 17 |
+
np.take(c, 0)
|
| 18 |
+
np.take(A, 0)
|
| 19 |
+
np.take(B, 0)
|
| 20 |
+
np.take(A, [0])
|
| 21 |
+
np.take(B, [0])
|
| 22 |
+
|
| 23 |
+
np.reshape(a, 1)
|
| 24 |
+
np.reshape(b, 1)
|
| 25 |
+
np.reshape(c, 1)
|
| 26 |
+
np.reshape(A, 1)
|
| 27 |
+
np.reshape(B, 1)
|
| 28 |
+
|
| 29 |
+
np.choose(a, [True, True])
|
| 30 |
+
np.choose(A, [1.0, 1.0])
|
| 31 |
+
|
| 32 |
+
np.repeat(a, 1)
|
| 33 |
+
np.repeat(b, 1)
|
| 34 |
+
np.repeat(c, 1)
|
| 35 |
+
np.repeat(A, 1)
|
| 36 |
+
np.repeat(B, 1)
|
| 37 |
+
|
| 38 |
+
np.swapaxes(A, 0, 0)
|
| 39 |
+
np.swapaxes(B, 0, 0)
|
| 40 |
+
|
| 41 |
+
np.transpose(a)
|
| 42 |
+
np.transpose(b)
|
| 43 |
+
np.transpose(c)
|
| 44 |
+
np.transpose(A)
|
| 45 |
+
np.transpose(B)
|
| 46 |
+
|
| 47 |
+
np.partition(a, 0, axis=None)
|
| 48 |
+
np.partition(b, 0, axis=None)
|
| 49 |
+
np.partition(c, 0, axis=None)
|
| 50 |
+
np.partition(A, 0)
|
| 51 |
+
np.partition(B, 0)
|
| 52 |
+
|
| 53 |
+
np.argpartition(a, 0)
|
| 54 |
+
np.argpartition(b, 0)
|
| 55 |
+
np.argpartition(c, 0)
|
| 56 |
+
np.argpartition(A, 0)
|
| 57 |
+
np.argpartition(B, 0)
|
| 58 |
+
|
| 59 |
+
np.sort(A, 0)
|
| 60 |
+
np.sort(B, 0)
|
| 61 |
+
|
| 62 |
+
np.argsort(A, 0)
|
| 63 |
+
np.argsort(B, 0)
|
| 64 |
+
|
| 65 |
+
np.argmax(A)
|
| 66 |
+
np.argmax(B)
|
| 67 |
+
np.argmax(A, axis=0)
|
| 68 |
+
np.argmax(B, axis=0)
|
| 69 |
+
|
| 70 |
+
np.argmin(A)
|
| 71 |
+
np.argmin(B)
|
| 72 |
+
np.argmin(A, axis=0)
|
| 73 |
+
np.argmin(B, axis=0)
|
| 74 |
+
|
| 75 |
+
np.searchsorted(A[0], 0)
|
| 76 |
+
np.searchsorted(B[0], 0)
|
| 77 |
+
np.searchsorted(A[0], [0])
|
| 78 |
+
np.searchsorted(B[0], [0])
|
| 79 |
+
|
| 80 |
+
np.resize(a, (5, 5))
|
| 81 |
+
np.resize(b, (5, 5))
|
| 82 |
+
np.resize(c, (5, 5))
|
| 83 |
+
np.resize(A, (5, 5))
|
| 84 |
+
np.resize(B, (5, 5))
|
| 85 |
+
|
| 86 |
+
np.squeeze(a)
|
| 87 |
+
np.squeeze(b)
|
| 88 |
+
np.squeeze(c)
|
| 89 |
+
np.squeeze(A)
|
| 90 |
+
np.squeeze(B)
|
| 91 |
+
|
| 92 |
+
np.diagonal(A)
|
| 93 |
+
np.diagonal(B)
|
| 94 |
+
|
| 95 |
+
np.trace(A)
|
| 96 |
+
np.trace(B)
|
| 97 |
+
|
| 98 |
+
np.ravel(a)
|
| 99 |
+
np.ravel(b)
|
| 100 |
+
np.ravel(c)
|
| 101 |
+
np.ravel(A)
|
| 102 |
+
np.ravel(B)
|
| 103 |
+
|
| 104 |
+
np.nonzero(A)
|
| 105 |
+
np.nonzero(B)
|
| 106 |
+
|
| 107 |
+
np.shape(a)
|
| 108 |
+
np.shape(b)
|
| 109 |
+
np.shape(c)
|
| 110 |
+
np.shape(A)
|
| 111 |
+
np.shape(B)
|
| 112 |
+
|
| 113 |
+
np.compress([True], a)
|
| 114 |
+
np.compress([True], b)
|
| 115 |
+
np.compress([True], c)
|
| 116 |
+
np.compress([True], A)
|
| 117 |
+
np.compress([True], B)
|
| 118 |
+
|
| 119 |
+
np.clip(a, 0, 1.0)
|
| 120 |
+
np.clip(b, -1, 1)
|
| 121 |
+
np.clip(a, 0, None)
|
| 122 |
+
np.clip(b, None, 1)
|
| 123 |
+
np.clip(c, 0, 1)
|
| 124 |
+
np.clip(A, 0, 1)
|
| 125 |
+
np.clip(B, 0, 1)
|
| 126 |
+
np.clip(B, [0, 1], [1, 2])
|
| 127 |
+
|
| 128 |
+
np.sum(a)
|
| 129 |
+
np.sum(b)
|
| 130 |
+
np.sum(c)
|
| 131 |
+
np.sum(A)
|
| 132 |
+
np.sum(B)
|
| 133 |
+
np.sum(A, axis=0)
|
| 134 |
+
np.sum(B, axis=0)
|
| 135 |
+
|
| 136 |
+
np.all(a)
|
| 137 |
+
np.all(b)
|
| 138 |
+
np.all(c)
|
| 139 |
+
np.all(A)
|
| 140 |
+
np.all(B)
|
| 141 |
+
np.all(A, axis=0)
|
| 142 |
+
np.all(B, axis=0)
|
| 143 |
+
np.all(A, keepdims=True)
|
| 144 |
+
np.all(B, keepdims=True)
|
| 145 |
+
|
| 146 |
+
np.any(a)
|
| 147 |
+
np.any(b)
|
| 148 |
+
np.any(c)
|
| 149 |
+
np.any(A)
|
| 150 |
+
np.any(B)
|
| 151 |
+
np.any(A, axis=0)
|
| 152 |
+
np.any(B, axis=0)
|
| 153 |
+
np.any(A, keepdims=True)
|
| 154 |
+
np.any(B, keepdims=True)
|
| 155 |
+
|
| 156 |
+
np.cumsum(a)
|
| 157 |
+
np.cumsum(b)
|
| 158 |
+
np.cumsum(c)
|
| 159 |
+
np.cumsum(A)
|
| 160 |
+
np.cumsum(B)
|
| 161 |
+
|
| 162 |
+
np.ptp(b)
|
| 163 |
+
np.ptp(c)
|
| 164 |
+
np.ptp(B)
|
| 165 |
+
np.ptp(B, axis=0)
|
| 166 |
+
np.ptp(B, keepdims=True)
|
| 167 |
+
|
| 168 |
+
np.amax(a)
|
| 169 |
+
np.amax(b)
|
| 170 |
+
np.amax(c)
|
| 171 |
+
np.amax(A)
|
| 172 |
+
np.amax(B)
|
| 173 |
+
np.amax(A, axis=0)
|
| 174 |
+
np.amax(B, axis=0)
|
| 175 |
+
np.amax(A, keepdims=True)
|
| 176 |
+
np.amax(B, keepdims=True)
|
| 177 |
+
|
| 178 |
+
np.amin(a)
|
| 179 |
+
np.amin(b)
|
| 180 |
+
np.amin(c)
|
| 181 |
+
np.amin(A)
|
| 182 |
+
np.amin(B)
|
| 183 |
+
np.amin(A, axis=0)
|
| 184 |
+
np.amin(B, axis=0)
|
| 185 |
+
np.amin(A, keepdims=True)
|
| 186 |
+
np.amin(B, keepdims=True)
|
| 187 |
+
|
| 188 |
+
np.prod(a)
|
| 189 |
+
np.prod(b)
|
| 190 |
+
np.prod(c)
|
| 191 |
+
np.prod(A)
|
| 192 |
+
np.prod(B)
|
| 193 |
+
np.prod(a, dtype=None)
|
| 194 |
+
np.prod(A, dtype=None)
|
| 195 |
+
np.prod(A, axis=0)
|
| 196 |
+
np.prod(B, axis=0)
|
| 197 |
+
np.prod(A, keepdims=True)
|
| 198 |
+
np.prod(B, keepdims=True)
|
| 199 |
+
np.prod(b, out=d)
|
| 200 |
+
np.prod(B, out=d)
|
| 201 |
+
|
| 202 |
+
np.cumprod(a)
|
| 203 |
+
np.cumprod(b)
|
| 204 |
+
np.cumprod(c)
|
| 205 |
+
np.cumprod(A)
|
| 206 |
+
np.cumprod(B)
|
| 207 |
+
|
| 208 |
+
np.ndim(a)
|
| 209 |
+
np.ndim(b)
|
| 210 |
+
np.ndim(c)
|
| 211 |
+
np.ndim(A)
|
| 212 |
+
np.ndim(B)
|
| 213 |
+
|
| 214 |
+
np.size(a)
|
| 215 |
+
np.size(b)
|
| 216 |
+
np.size(c)
|
| 217 |
+
np.size(A)
|
| 218 |
+
np.size(B)
|
| 219 |
+
|
| 220 |
+
np.around(a)
|
| 221 |
+
np.around(b)
|
| 222 |
+
np.around(c)
|
| 223 |
+
np.around(A)
|
| 224 |
+
np.around(B)
|
| 225 |
+
|
| 226 |
+
np.mean(a)
|
| 227 |
+
np.mean(b)
|
| 228 |
+
np.mean(c)
|
| 229 |
+
np.mean(A)
|
| 230 |
+
np.mean(B)
|
| 231 |
+
np.mean(A, axis=0)
|
| 232 |
+
np.mean(B, axis=0)
|
| 233 |
+
np.mean(A, keepdims=True)
|
| 234 |
+
np.mean(B, keepdims=True)
|
| 235 |
+
np.mean(b, out=d)
|
| 236 |
+
np.mean(B, out=d)
|
| 237 |
+
|
| 238 |
+
np.std(a)
|
| 239 |
+
np.std(b)
|
| 240 |
+
np.std(c)
|
| 241 |
+
np.std(A)
|
| 242 |
+
np.std(B)
|
| 243 |
+
np.std(A, axis=0)
|
| 244 |
+
np.std(B, axis=0)
|
| 245 |
+
np.std(A, keepdims=True)
|
| 246 |
+
np.std(B, keepdims=True)
|
| 247 |
+
np.std(b, out=d)
|
| 248 |
+
np.std(B, out=d)
|
| 249 |
+
|
| 250 |
+
np.var(a)
|
| 251 |
+
np.var(b)
|
| 252 |
+
np.var(c)
|
| 253 |
+
np.var(A)
|
| 254 |
+
np.var(B)
|
| 255 |
+
np.var(A, axis=0)
|
| 256 |
+
np.var(B, axis=0)
|
| 257 |
+
np.var(A, keepdims=True)
|
| 258 |
+
np.var(B, keepdims=True)
|
| 259 |
+
np.var(b, out=d)
|
| 260 |
+
np.var(B, out=d)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/index_tricks.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
from typing import Any
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
AR_LIKE_b = [[True, True], [True, True]]
|
| 6 |
+
AR_LIKE_i = [[1, 2], [3, 4]]
|
| 7 |
+
AR_LIKE_f = [[1.0, 2.0], [3.0, 4.0]]
|
| 8 |
+
AR_LIKE_U = [["1", "2"], ["3", "4"]]
|
| 9 |
+
|
| 10 |
+
AR_i8: np.ndarray[Any, np.dtype[np.int64]] = np.array(AR_LIKE_i, dtype=np.int64)
|
| 11 |
+
|
| 12 |
+
np.ndenumerate(AR_i8)
|
| 13 |
+
np.ndenumerate(AR_LIKE_f)
|
| 14 |
+
np.ndenumerate(AR_LIKE_U)
|
| 15 |
+
|
| 16 |
+
np.ndenumerate(AR_i8).iter
|
| 17 |
+
np.ndenumerate(AR_LIKE_f).iter
|
| 18 |
+
np.ndenumerate(AR_LIKE_U).iter
|
| 19 |
+
|
| 20 |
+
next(np.ndenumerate(AR_i8))
|
| 21 |
+
next(np.ndenumerate(AR_LIKE_f))
|
| 22 |
+
next(np.ndenumerate(AR_LIKE_U))
|
| 23 |
+
|
| 24 |
+
iter(np.ndenumerate(AR_i8))
|
| 25 |
+
iter(np.ndenumerate(AR_LIKE_f))
|
| 26 |
+
iter(np.ndenumerate(AR_LIKE_U))
|
| 27 |
+
|
| 28 |
+
iter(np.ndindex(1, 2, 3))
|
| 29 |
+
next(np.ndindex(1, 2, 3))
|
| 30 |
+
|
| 31 |
+
np.unravel_index([22, 41, 37], (7, 6))
|
| 32 |
+
np.unravel_index([31, 41, 13], (7, 6), order='F')
|
| 33 |
+
np.unravel_index(1621, (6, 7, 8, 9))
|
| 34 |
+
|
| 35 |
+
np.ravel_multi_index(AR_LIKE_i, (7, 6))
|
| 36 |
+
np.ravel_multi_index(AR_LIKE_i, (7, 6), order='F')
|
| 37 |
+
np.ravel_multi_index(AR_LIKE_i, (4, 6), mode='clip')
|
| 38 |
+
np.ravel_multi_index(AR_LIKE_i, (4, 4), mode=('clip', 'wrap'))
|
| 39 |
+
np.ravel_multi_index((3, 1, 4, 1), (6, 7, 8, 9))
|
| 40 |
+
|
| 41 |
+
np.mgrid[1:1:2]
|
| 42 |
+
np.mgrid[1:1:2, None:10]
|
| 43 |
+
|
| 44 |
+
np.ogrid[1:1:2]
|
| 45 |
+
np.ogrid[1:1:2, None:10]
|
| 46 |
+
|
| 47 |
+
np.index_exp[0:1]
|
| 48 |
+
np.index_exp[0:1, None:3]
|
| 49 |
+
np.index_exp[0, 0:1, ..., [0, 1, 3]]
|
| 50 |
+
|
| 51 |
+
np.s_[0:1]
|
| 52 |
+
np.s_[0:1, None:3]
|
| 53 |
+
np.s_[0, 0:1, ..., [0, 1, 3]]
|
| 54 |
+
|
| 55 |
+
np.ix_(AR_LIKE_b[0])
|
| 56 |
+
np.ix_(AR_LIKE_i[0], AR_LIKE_f[0])
|
| 57 |
+
np.ix_(AR_i8[0])
|
| 58 |
+
|
| 59 |
+
np.fill_diagonal(AR_i8, 5)
|
| 60 |
+
|
| 61 |
+
np.diag_indices(4)
|
| 62 |
+
np.diag_indices(2, 3)
|
| 63 |
+
|
| 64 |
+
np.diag_indices_from(AR_i8)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/literal.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from functools import partial
|
| 4 |
+
from collections.abc import Callable
|
| 5 |
+
|
| 6 |
+
import pytest # type: ignore
|
| 7 |
+
import numpy as np
|
| 8 |
+
|
| 9 |
+
AR = np.array(0)
|
| 10 |
+
AR.setflags(write=False)
|
| 11 |
+
|
| 12 |
+
KACF = frozenset({None, "K", "A", "C", "F"})
|
| 13 |
+
ACF = frozenset({None, "A", "C", "F"})
|
| 14 |
+
CF = frozenset({None, "C", "F"})
|
| 15 |
+
|
| 16 |
+
order_list: list[tuple[frozenset, Callable]] = [
|
| 17 |
+
(KACF, partial(np.ndarray, 1)),
|
| 18 |
+
(KACF, AR.tobytes),
|
| 19 |
+
(KACF, partial(AR.astype, int)),
|
| 20 |
+
(KACF, AR.copy),
|
| 21 |
+
(ACF, partial(AR.reshape, 1)),
|
| 22 |
+
(KACF, AR.flatten),
|
| 23 |
+
(KACF, AR.ravel),
|
| 24 |
+
(KACF, partial(np.array, 1)),
|
| 25 |
+
(CF, partial(np.zeros, 1)),
|
| 26 |
+
(CF, partial(np.ones, 1)),
|
| 27 |
+
(CF, partial(np.empty, 1)),
|
| 28 |
+
(CF, partial(np.full, 1, 1)),
|
| 29 |
+
(KACF, partial(np.zeros_like, AR)),
|
| 30 |
+
(KACF, partial(np.ones_like, AR)),
|
| 31 |
+
(KACF, partial(np.empty_like, AR)),
|
| 32 |
+
(KACF, partial(np.full_like, AR, 1)),
|
| 33 |
+
(KACF, partial(np.add, 1, 1)), # i.e. np.ufunc.__call__
|
| 34 |
+
(ACF, partial(np.reshape, AR, 1)),
|
| 35 |
+
(KACF, partial(np.ravel, AR)),
|
| 36 |
+
(KACF, partial(np.asarray, 1)),
|
| 37 |
+
(KACF, partial(np.asanyarray, 1)),
|
| 38 |
+
]
|
| 39 |
+
|
| 40 |
+
for order_set, func in order_list:
|
| 41 |
+
for order in order_set:
|
| 42 |
+
func(order=order)
|
| 43 |
+
|
| 44 |
+
invalid_orders = KACF - order_set
|
| 45 |
+
for order in invalid_orders:
|
| 46 |
+
with pytest.raises(ValueError):
|
| 47 |
+
func(order=order)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/mod.py
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
f8 = np.float64(1)
|
| 4 |
+
i8 = np.int64(1)
|
| 5 |
+
u8 = np.uint64(1)
|
| 6 |
+
|
| 7 |
+
f4 = np.float32(1)
|
| 8 |
+
i4 = np.int32(1)
|
| 9 |
+
u4 = np.uint32(1)
|
| 10 |
+
|
| 11 |
+
td = np.timedelta64(1, "D")
|
| 12 |
+
b_ = np.bool_(1)
|
| 13 |
+
|
| 14 |
+
b = bool(1)
|
| 15 |
+
f = float(1)
|
| 16 |
+
i = int(1)
|
| 17 |
+
|
| 18 |
+
AR = np.array([1], dtype=np.bool_)
|
| 19 |
+
AR.setflags(write=False)
|
| 20 |
+
|
| 21 |
+
AR2 = np.array([1], dtype=np.timedelta64)
|
| 22 |
+
AR2.setflags(write=False)
|
| 23 |
+
|
| 24 |
+
# Time structures
|
| 25 |
+
|
| 26 |
+
td % td
|
| 27 |
+
td % AR2
|
| 28 |
+
AR2 % td
|
| 29 |
+
|
| 30 |
+
divmod(td, td)
|
| 31 |
+
divmod(td, AR2)
|
| 32 |
+
divmod(AR2, td)
|
| 33 |
+
|
| 34 |
+
# Bool
|
| 35 |
+
|
| 36 |
+
b_ % b
|
| 37 |
+
b_ % i
|
| 38 |
+
b_ % f
|
| 39 |
+
b_ % b_
|
| 40 |
+
b_ % i8
|
| 41 |
+
b_ % u8
|
| 42 |
+
b_ % f8
|
| 43 |
+
b_ % AR
|
| 44 |
+
|
| 45 |
+
divmod(b_, b)
|
| 46 |
+
divmod(b_, i)
|
| 47 |
+
divmod(b_, f)
|
| 48 |
+
divmod(b_, b_)
|
| 49 |
+
divmod(b_, i8)
|
| 50 |
+
divmod(b_, u8)
|
| 51 |
+
divmod(b_, f8)
|
| 52 |
+
divmod(b_, AR)
|
| 53 |
+
|
| 54 |
+
b % b_
|
| 55 |
+
i % b_
|
| 56 |
+
f % b_
|
| 57 |
+
b_ % b_
|
| 58 |
+
i8 % b_
|
| 59 |
+
u8 % b_
|
| 60 |
+
f8 % b_
|
| 61 |
+
AR % b_
|
| 62 |
+
|
| 63 |
+
divmod(b, b_)
|
| 64 |
+
divmod(i, b_)
|
| 65 |
+
divmod(f, b_)
|
| 66 |
+
divmod(b_, b_)
|
| 67 |
+
divmod(i8, b_)
|
| 68 |
+
divmod(u8, b_)
|
| 69 |
+
divmod(f8, b_)
|
| 70 |
+
divmod(AR, b_)
|
| 71 |
+
|
| 72 |
+
# int
|
| 73 |
+
|
| 74 |
+
i8 % b
|
| 75 |
+
i8 % i
|
| 76 |
+
i8 % f
|
| 77 |
+
i8 % i8
|
| 78 |
+
i8 % f8
|
| 79 |
+
i4 % i8
|
| 80 |
+
i4 % f8
|
| 81 |
+
i4 % i4
|
| 82 |
+
i4 % f4
|
| 83 |
+
i8 % AR
|
| 84 |
+
|
| 85 |
+
divmod(i8, b)
|
| 86 |
+
divmod(i8, i)
|
| 87 |
+
divmod(i8, f)
|
| 88 |
+
divmod(i8, i8)
|
| 89 |
+
divmod(i8, f8)
|
| 90 |
+
divmod(i8, i4)
|
| 91 |
+
divmod(i8, f4)
|
| 92 |
+
divmod(i4, i4)
|
| 93 |
+
divmod(i4, f4)
|
| 94 |
+
divmod(i8, AR)
|
| 95 |
+
|
| 96 |
+
b % i8
|
| 97 |
+
i % i8
|
| 98 |
+
f % i8
|
| 99 |
+
i8 % i8
|
| 100 |
+
f8 % i8
|
| 101 |
+
i8 % i4
|
| 102 |
+
f8 % i4
|
| 103 |
+
i4 % i4
|
| 104 |
+
f4 % i4
|
| 105 |
+
AR % i8
|
| 106 |
+
|
| 107 |
+
divmod(b, i8)
|
| 108 |
+
divmod(i, i8)
|
| 109 |
+
divmod(f, i8)
|
| 110 |
+
divmod(i8, i8)
|
| 111 |
+
divmod(f8, i8)
|
| 112 |
+
divmod(i4, i8)
|
| 113 |
+
divmod(f4, i8)
|
| 114 |
+
divmod(i4, i4)
|
| 115 |
+
divmod(f4, i4)
|
| 116 |
+
divmod(AR, i8)
|
| 117 |
+
|
| 118 |
+
# float
|
| 119 |
+
|
| 120 |
+
f8 % b
|
| 121 |
+
f8 % i
|
| 122 |
+
f8 % f
|
| 123 |
+
i8 % f4
|
| 124 |
+
f4 % f4
|
| 125 |
+
f8 % AR
|
| 126 |
+
|
| 127 |
+
divmod(f8, b)
|
| 128 |
+
divmod(f8, i)
|
| 129 |
+
divmod(f8, f)
|
| 130 |
+
divmod(f8, f8)
|
| 131 |
+
divmod(f8, f4)
|
| 132 |
+
divmod(f4, f4)
|
| 133 |
+
divmod(f8, AR)
|
| 134 |
+
|
| 135 |
+
b % f8
|
| 136 |
+
i % f8
|
| 137 |
+
f % f8
|
| 138 |
+
f8 % f8
|
| 139 |
+
f8 % f8
|
| 140 |
+
f4 % f4
|
| 141 |
+
AR % f8
|
| 142 |
+
|
| 143 |
+
divmod(b, f8)
|
| 144 |
+
divmod(i, f8)
|
| 145 |
+
divmod(f, f8)
|
| 146 |
+
divmod(f8, f8)
|
| 147 |
+
divmod(f4, f8)
|
| 148 |
+
divmod(f4, f4)
|
| 149 |
+
divmod(AR, f8)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/numerictypes.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
np.maximum_sctype("S8")
|
| 4 |
+
np.maximum_sctype(object)
|
| 5 |
+
|
| 6 |
+
np.issctype(object)
|
| 7 |
+
np.issctype("S8")
|
| 8 |
+
|
| 9 |
+
np.obj2sctype(list)
|
| 10 |
+
np.obj2sctype(list, default=None)
|
| 11 |
+
np.obj2sctype(list, default=np.bytes_)
|
| 12 |
+
|
| 13 |
+
np.issubclass_(np.int32, int)
|
| 14 |
+
np.issubclass_(np.float64, float)
|
| 15 |
+
np.issubclass_(np.float64, (int, float))
|
| 16 |
+
|
| 17 |
+
np.issubsctype("int64", int)
|
| 18 |
+
np.issubsctype(np.array([1]), np.array([1]))
|
| 19 |
+
|
| 20 |
+
np.issubdtype("S1", np.bytes_)
|
| 21 |
+
np.issubdtype(np.float64, np.float32)
|
| 22 |
+
|
| 23 |
+
np.sctype2char("S1")
|
| 24 |
+
np.sctype2char(list)
|
| 25 |
+
|
| 26 |
+
np.cast[int]
|
| 27 |
+
np.cast["i8"]
|
| 28 |
+
np.cast[np.int64]
|
| 29 |
+
|
| 30 |
+
np.nbytes[int]
|
| 31 |
+
np.nbytes["i8"]
|
| 32 |
+
np.nbytes[np.int64]
|
| 33 |
+
|
| 34 |
+
np.ScalarType
|
| 35 |
+
np.ScalarType[0]
|
| 36 |
+
np.ScalarType[3]
|
| 37 |
+
np.ScalarType[8]
|
| 38 |
+
np.ScalarType[10]
|
| 39 |
+
|
| 40 |
+
np.typecodes["Character"]
|
| 41 |
+
np.typecodes["Complex"]
|
| 42 |
+
np.typecodes["All"]
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/random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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from typing import Any
|
| 4 |
+
import numpy as np
|
| 5 |
+
|
| 6 |
+
SEED_NONE = None
|
| 7 |
+
SEED_INT = 4579435749574957634658964293569
|
| 8 |
+
SEED_ARR: np.ndarray[Any, np.dtype[np.int64]] = np.array([1, 2, 3, 4], dtype=np.int64)
|
| 9 |
+
SEED_ARRLIKE: list[int] = [1, 2, 3, 4]
|
| 10 |
+
SEED_SEED_SEQ: np.random.SeedSequence = np.random.SeedSequence(0)
|
| 11 |
+
SEED_MT19937: np.random.MT19937 = np.random.MT19937(0)
|
| 12 |
+
SEED_PCG64: np.random.PCG64 = np.random.PCG64(0)
|
| 13 |
+
SEED_PHILOX: np.random.Philox = np.random.Philox(0)
|
| 14 |
+
SEED_SFC64: np.random.SFC64 = np.random.SFC64(0)
|
| 15 |
+
|
| 16 |
+
# default rng
|
| 17 |
+
np.random.default_rng()
|
| 18 |
+
np.random.default_rng(SEED_NONE)
|
| 19 |
+
np.random.default_rng(SEED_INT)
|
| 20 |
+
np.random.default_rng(SEED_ARR)
|
| 21 |
+
np.random.default_rng(SEED_ARRLIKE)
|
| 22 |
+
np.random.default_rng(SEED_SEED_SEQ)
|
| 23 |
+
np.random.default_rng(SEED_MT19937)
|
| 24 |
+
np.random.default_rng(SEED_PCG64)
|
| 25 |
+
np.random.default_rng(SEED_PHILOX)
|
| 26 |
+
np.random.default_rng(SEED_SFC64)
|
| 27 |
+
|
| 28 |
+
# Seed Sequence
|
| 29 |
+
np.random.SeedSequence(SEED_NONE)
|
| 30 |
+
np.random.SeedSequence(SEED_INT)
|
| 31 |
+
np.random.SeedSequence(SEED_ARR)
|
| 32 |
+
np.random.SeedSequence(SEED_ARRLIKE)
|
| 33 |
+
|
| 34 |
+
# Bit Generators
|
| 35 |
+
np.random.MT19937(SEED_NONE)
|
| 36 |
+
np.random.MT19937(SEED_INT)
|
| 37 |
+
np.random.MT19937(SEED_ARR)
|
| 38 |
+
np.random.MT19937(SEED_ARRLIKE)
|
| 39 |
+
np.random.MT19937(SEED_SEED_SEQ)
|
| 40 |
+
|
| 41 |
+
np.random.PCG64(SEED_NONE)
|
| 42 |
+
np.random.PCG64(SEED_INT)
|
| 43 |
+
np.random.PCG64(SEED_ARR)
|
| 44 |
+
np.random.PCG64(SEED_ARRLIKE)
|
| 45 |
+
np.random.PCG64(SEED_SEED_SEQ)
|
| 46 |
+
|
| 47 |
+
np.random.Philox(SEED_NONE)
|
| 48 |
+
np.random.Philox(SEED_INT)
|
| 49 |
+
np.random.Philox(SEED_ARR)
|
| 50 |
+
np.random.Philox(SEED_ARRLIKE)
|
| 51 |
+
np.random.Philox(SEED_SEED_SEQ)
|
| 52 |
+
|
| 53 |
+
np.random.SFC64(SEED_NONE)
|
| 54 |
+
np.random.SFC64(SEED_INT)
|
| 55 |
+
np.random.SFC64(SEED_ARR)
|
| 56 |
+
np.random.SFC64(SEED_ARRLIKE)
|
| 57 |
+
np.random.SFC64(SEED_SEED_SEQ)
|
| 58 |
+
|
| 59 |
+
seed_seq: np.random.bit_generator.SeedSequence = np.random.SeedSequence(SEED_NONE)
|
| 60 |
+
seed_seq.spawn(10)
|
| 61 |
+
seed_seq.generate_state(3)
|
| 62 |
+
seed_seq.generate_state(3, "u4")
|
| 63 |
+
seed_seq.generate_state(3, "uint32")
|
| 64 |
+
seed_seq.generate_state(3, "u8")
|
| 65 |
+
seed_seq.generate_state(3, "uint64")
|
| 66 |
+
seed_seq.generate_state(3, np.uint32)
|
| 67 |
+
seed_seq.generate_state(3, np.uint64)
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def_gen: np.random.Generator = np.random.default_rng()
|
| 71 |
+
|
| 72 |
+
D_arr_0p1: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.1])
|
| 73 |
+
D_arr_0p5: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.5])
|
| 74 |
+
D_arr_0p9: np.ndarray[Any, np.dtype[np.float64]] = np.array([0.9])
|
| 75 |
+
D_arr_1p5: np.ndarray[Any, np.dtype[np.float64]] = np.array([1.5])
|
| 76 |
+
I_arr_10: np.ndarray[Any, np.dtype[np.int_]] = np.array([10], dtype=np.int_)
|
| 77 |
+
I_arr_20: np.ndarray[Any, np.dtype[np.int_]] = np.array([20], dtype=np.int_)
|
| 78 |
+
D_arr_like_0p1: list[float] = [0.1]
|
| 79 |
+
D_arr_like_0p5: list[float] = [0.5]
|
| 80 |
+
D_arr_like_0p9: list[float] = [0.9]
|
| 81 |
+
D_arr_like_1p5: list[float] = [1.5]
|
| 82 |
+
I_arr_like_10: list[int] = [10]
|
| 83 |
+
I_arr_like_20: list[int] = [20]
|
| 84 |
+
D_2D_like: list[list[float]] = [[1, 2], [2, 3], [3, 4], [4, 5.1]]
|
| 85 |
+
D_2D: np.ndarray[Any, np.dtype[np.float64]] = np.array(D_2D_like)
|
| 86 |
+
|
| 87 |
+
S_out: np.ndarray[Any, np.dtype[np.float32]] = np.empty(1, dtype=np.float32)
|
| 88 |
+
D_out: np.ndarray[Any, np.dtype[np.float64]] = np.empty(1)
|
| 89 |
+
|
| 90 |
+
def_gen.standard_normal()
|
| 91 |
+
def_gen.standard_normal(dtype=np.float32)
|
| 92 |
+
def_gen.standard_normal(dtype="float32")
|
| 93 |
+
def_gen.standard_normal(dtype="double")
|
| 94 |
+
def_gen.standard_normal(dtype=np.float64)
|
| 95 |
+
def_gen.standard_normal(size=None)
|
| 96 |
+
def_gen.standard_normal(size=1)
|
| 97 |
+
def_gen.standard_normal(size=1, dtype=np.float32)
|
| 98 |
+
def_gen.standard_normal(size=1, dtype="f4")
|
| 99 |
+
def_gen.standard_normal(size=1, dtype="float32", out=S_out)
|
| 100 |
+
def_gen.standard_normal(dtype=np.float32, out=S_out)
|
| 101 |
+
def_gen.standard_normal(size=1, dtype=np.float64)
|
| 102 |
+
def_gen.standard_normal(size=1, dtype="float64")
|
| 103 |
+
def_gen.standard_normal(size=1, dtype="f8")
|
| 104 |
+
def_gen.standard_normal(out=D_out)
|
| 105 |
+
def_gen.standard_normal(size=1, dtype="float64")
|
| 106 |
+
def_gen.standard_normal(size=1, dtype="float64", out=D_out)
|
| 107 |
+
|
| 108 |
+
def_gen.random()
|
| 109 |
+
def_gen.random(dtype=np.float32)
|
| 110 |
+
def_gen.random(dtype="float32")
|
| 111 |
+
def_gen.random(dtype="double")
|
| 112 |
+
def_gen.random(dtype=np.float64)
|
| 113 |
+
def_gen.random(size=None)
|
| 114 |
+
def_gen.random(size=1)
|
| 115 |
+
def_gen.random(size=1, dtype=np.float32)
|
| 116 |
+
def_gen.random(size=1, dtype="f4")
|
| 117 |
+
def_gen.random(size=1, dtype="float32", out=S_out)
|
| 118 |
+
def_gen.random(dtype=np.float32, out=S_out)
|
| 119 |
+
def_gen.random(size=1, dtype=np.float64)
|
| 120 |
+
def_gen.random(size=1, dtype="float64")
|
| 121 |
+
def_gen.random(size=1, dtype="f8")
|
| 122 |
+
def_gen.random(out=D_out)
|
| 123 |
+
def_gen.random(size=1, dtype="float64")
|
| 124 |
+
def_gen.random(size=1, dtype="float64", out=D_out)
|
| 125 |
+
|
| 126 |
+
def_gen.standard_cauchy()
|
| 127 |
+
def_gen.standard_cauchy(size=None)
|
| 128 |
+
def_gen.standard_cauchy(size=1)
|
| 129 |
+
|
| 130 |
+
def_gen.standard_exponential()
|
| 131 |
+
def_gen.standard_exponential(method="inv")
|
| 132 |
+
def_gen.standard_exponential(dtype=np.float32)
|
| 133 |
+
def_gen.standard_exponential(dtype="float32")
|
| 134 |
+
def_gen.standard_exponential(dtype="double")
|
| 135 |
+
def_gen.standard_exponential(dtype=np.float64)
|
| 136 |
+
def_gen.standard_exponential(size=None)
|
| 137 |
+
def_gen.standard_exponential(size=None, method="inv")
|
| 138 |
+
def_gen.standard_exponential(size=1, method="inv")
|
| 139 |
+
def_gen.standard_exponential(size=1, dtype=np.float32)
|
| 140 |
+
def_gen.standard_exponential(size=1, dtype="f4", method="inv")
|
| 141 |
+
def_gen.standard_exponential(size=1, dtype="float32", out=S_out)
|
| 142 |
+
def_gen.standard_exponential(dtype=np.float32, out=S_out)
|
| 143 |
+
def_gen.standard_exponential(size=1, dtype=np.float64, method="inv")
|
| 144 |
+
def_gen.standard_exponential(size=1, dtype="float64")
|
| 145 |
+
def_gen.standard_exponential(size=1, dtype="f8")
|
| 146 |
+
def_gen.standard_exponential(out=D_out)
|
| 147 |
+
def_gen.standard_exponential(size=1, dtype="float64")
|
| 148 |
+
def_gen.standard_exponential(size=1, dtype="float64", out=D_out)
|
| 149 |
+
|
| 150 |
+
def_gen.zipf(1.5)
|
| 151 |
+
def_gen.zipf(1.5, size=None)
|
| 152 |
+
def_gen.zipf(1.5, size=1)
|
| 153 |
+
def_gen.zipf(D_arr_1p5)
|
| 154 |
+
def_gen.zipf(D_arr_1p5, size=1)
|
| 155 |
+
def_gen.zipf(D_arr_like_1p5)
|
| 156 |
+
def_gen.zipf(D_arr_like_1p5, size=1)
|
| 157 |
+
|
| 158 |
+
def_gen.weibull(0.5)
|
| 159 |
+
def_gen.weibull(0.5, size=None)
|
| 160 |
+
def_gen.weibull(0.5, size=1)
|
| 161 |
+
def_gen.weibull(D_arr_0p5)
|
| 162 |
+
def_gen.weibull(D_arr_0p5, size=1)
|
| 163 |
+
def_gen.weibull(D_arr_like_0p5)
|
| 164 |
+
def_gen.weibull(D_arr_like_0p5, size=1)
|
| 165 |
+
|
| 166 |
+
def_gen.standard_t(0.5)
|
| 167 |
+
def_gen.standard_t(0.5, size=None)
|
| 168 |
+
def_gen.standard_t(0.5, size=1)
|
| 169 |
+
def_gen.standard_t(D_arr_0p5)
|
| 170 |
+
def_gen.standard_t(D_arr_0p5, size=1)
|
| 171 |
+
def_gen.standard_t(D_arr_like_0p5)
|
| 172 |
+
def_gen.standard_t(D_arr_like_0p5, size=1)
|
| 173 |
+
|
| 174 |
+
def_gen.poisson(0.5)
|
| 175 |
+
def_gen.poisson(0.5, size=None)
|
| 176 |
+
def_gen.poisson(0.5, size=1)
|
| 177 |
+
def_gen.poisson(D_arr_0p5)
|
| 178 |
+
def_gen.poisson(D_arr_0p5, size=1)
|
| 179 |
+
def_gen.poisson(D_arr_like_0p5)
|
| 180 |
+
def_gen.poisson(D_arr_like_0p5, size=1)
|
| 181 |
+
|
| 182 |
+
def_gen.power(0.5)
|
| 183 |
+
def_gen.power(0.5, size=None)
|
| 184 |
+
def_gen.power(0.5, size=1)
|
| 185 |
+
def_gen.power(D_arr_0p5)
|
| 186 |
+
def_gen.power(D_arr_0p5, size=1)
|
| 187 |
+
def_gen.power(D_arr_like_0p5)
|
| 188 |
+
def_gen.power(D_arr_like_0p5, size=1)
|
| 189 |
+
|
| 190 |
+
def_gen.pareto(0.5)
|
| 191 |
+
def_gen.pareto(0.5, size=None)
|
| 192 |
+
def_gen.pareto(0.5, size=1)
|
| 193 |
+
def_gen.pareto(D_arr_0p5)
|
| 194 |
+
def_gen.pareto(D_arr_0p5, size=1)
|
| 195 |
+
def_gen.pareto(D_arr_like_0p5)
|
| 196 |
+
def_gen.pareto(D_arr_like_0p5, size=1)
|
| 197 |
+
|
| 198 |
+
def_gen.chisquare(0.5)
|
| 199 |
+
def_gen.chisquare(0.5, size=None)
|
| 200 |
+
def_gen.chisquare(0.5, size=1)
|
| 201 |
+
def_gen.chisquare(D_arr_0p5)
|
| 202 |
+
def_gen.chisquare(D_arr_0p5, size=1)
|
| 203 |
+
def_gen.chisquare(D_arr_like_0p5)
|
| 204 |
+
def_gen.chisquare(D_arr_like_0p5, size=1)
|
| 205 |
+
|
| 206 |
+
def_gen.exponential(0.5)
|
| 207 |
+
def_gen.exponential(0.5, size=None)
|
| 208 |
+
def_gen.exponential(0.5, size=1)
|
| 209 |
+
def_gen.exponential(D_arr_0p5)
|
| 210 |
+
def_gen.exponential(D_arr_0p5, size=1)
|
| 211 |
+
def_gen.exponential(D_arr_like_0p5)
|
| 212 |
+
def_gen.exponential(D_arr_like_0p5, size=1)
|
| 213 |
+
|
| 214 |
+
def_gen.geometric(0.5)
|
| 215 |
+
def_gen.geometric(0.5, size=None)
|
| 216 |
+
def_gen.geometric(0.5, size=1)
|
| 217 |
+
def_gen.geometric(D_arr_0p5)
|
| 218 |
+
def_gen.geometric(D_arr_0p5, size=1)
|
| 219 |
+
def_gen.geometric(D_arr_like_0p5)
|
| 220 |
+
def_gen.geometric(D_arr_like_0p5, size=1)
|
| 221 |
+
|
| 222 |
+
def_gen.logseries(0.5)
|
| 223 |
+
def_gen.logseries(0.5, size=None)
|
| 224 |
+
def_gen.logseries(0.5, size=1)
|
| 225 |
+
def_gen.logseries(D_arr_0p5)
|
| 226 |
+
def_gen.logseries(D_arr_0p5, size=1)
|
| 227 |
+
def_gen.logseries(D_arr_like_0p5)
|
| 228 |
+
def_gen.logseries(D_arr_like_0p5, size=1)
|
| 229 |
+
|
| 230 |
+
def_gen.rayleigh(0.5)
|
| 231 |
+
def_gen.rayleigh(0.5, size=None)
|
| 232 |
+
def_gen.rayleigh(0.5, size=1)
|
| 233 |
+
def_gen.rayleigh(D_arr_0p5)
|
| 234 |
+
def_gen.rayleigh(D_arr_0p5, size=1)
|
| 235 |
+
def_gen.rayleigh(D_arr_like_0p5)
|
| 236 |
+
def_gen.rayleigh(D_arr_like_0p5, size=1)
|
| 237 |
+
|
| 238 |
+
def_gen.standard_gamma(0.5)
|
| 239 |
+
def_gen.standard_gamma(0.5, size=None)
|
| 240 |
+
def_gen.standard_gamma(0.5, dtype="float32")
|
| 241 |
+
def_gen.standard_gamma(0.5, size=None, dtype="float32")
|
| 242 |
+
def_gen.standard_gamma(0.5, size=1)
|
| 243 |
+
def_gen.standard_gamma(D_arr_0p5)
|
| 244 |
+
def_gen.standard_gamma(D_arr_0p5, dtype="f4")
|
| 245 |
+
def_gen.standard_gamma(0.5, size=1, dtype="float32", out=S_out)
|
| 246 |
+
def_gen.standard_gamma(D_arr_0p5, dtype=np.float32, out=S_out)
|
| 247 |
+
def_gen.standard_gamma(D_arr_0p5, size=1)
|
| 248 |
+
def_gen.standard_gamma(D_arr_like_0p5)
|
| 249 |
+
def_gen.standard_gamma(D_arr_like_0p5, size=1)
|
| 250 |
+
def_gen.standard_gamma(0.5, out=D_out)
|
| 251 |
+
def_gen.standard_gamma(D_arr_like_0p5, out=D_out)
|
| 252 |
+
def_gen.standard_gamma(D_arr_like_0p5, size=1)
|
| 253 |
+
def_gen.standard_gamma(D_arr_like_0p5, size=1, out=D_out, dtype=np.float64)
|
| 254 |
+
|
| 255 |
+
def_gen.vonmises(0.5, 0.5)
|
| 256 |
+
def_gen.vonmises(0.5, 0.5, size=None)
|
| 257 |
+
def_gen.vonmises(0.5, 0.5, size=1)
|
| 258 |
+
def_gen.vonmises(D_arr_0p5, 0.5)
|
| 259 |
+
def_gen.vonmises(0.5, D_arr_0p5)
|
| 260 |
+
def_gen.vonmises(D_arr_0p5, 0.5, size=1)
|
| 261 |
+
def_gen.vonmises(0.5, D_arr_0p5, size=1)
|
| 262 |
+
def_gen.vonmises(D_arr_like_0p5, 0.5)
|
| 263 |
+
def_gen.vonmises(0.5, D_arr_like_0p5)
|
| 264 |
+
def_gen.vonmises(D_arr_0p5, D_arr_0p5)
|
| 265 |
+
def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5)
|
| 266 |
+
def_gen.vonmises(D_arr_0p5, D_arr_0p5, size=1)
|
| 267 |
+
def_gen.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 268 |
+
|
| 269 |
+
def_gen.wald(0.5, 0.5)
|
| 270 |
+
def_gen.wald(0.5, 0.5, size=None)
|
| 271 |
+
def_gen.wald(0.5, 0.5, size=1)
|
| 272 |
+
def_gen.wald(D_arr_0p5, 0.5)
|
| 273 |
+
def_gen.wald(0.5, D_arr_0p5)
|
| 274 |
+
def_gen.wald(D_arr_0p5, 0.5, size=1)
|
| 275 |
+
def_gen.wald(0.5, D_arr_0p5, size=1)
|
| 276 |
+
def_gen.wald(D_arr_like_0p5, 0.5)
|
| 277 |
+
def_gen.wald(0.5, D_arr_like_0p5)
|
| 278 |
+
def_gen.wald(D_arr_0p5, D_arr_0p5)
|
| 279 |
+
def_gen.wald(D_arr_like_0p5, D_arr_like_0p5)
|
| 280 |
+
def_gen.wald(D_arr_0p5, D_arr_0p5, size=1)
|
| 281 |
+
def_gen.wald(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 282 |
+
|
| 283 |
+
def_gen.uniform(0.5, 0.5)
|
| 284 |
+
def_gen.uniform(0.5, 0.5, size=None)
|
| 285 |
+
def_gen.uniform(0.5, 0.5, size=1)
|
| 286 |
+
def_gen.uniform(D_arr_0p5, 0.5)
|
| 287 |
+
def_gen.uniform(0.5, D_arr_0p5)
|
| 288 |
+
def_gen.uniform(D_arr_0p5, 0.5, size=1)
|
| 289 |
+
def_gen.uniform(0.5, D_arr_0p5, size=1)
|
| 290 |
+
def_gen.uniform(D_arr_like_0p5, 0.5)
|
| 291 |
+
def_gen.uniform(0.5, D_arr_like_0p5)
|
| 292 |
+
def_gen.uniform(D_arr_0p5, D_arr_0p5)
|
| 293 |
+
def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5)
|
| 294 |
+
def_gen.uniform(D_arr_0p5, D_arr_0p5, size=1)
|
| 295 |
+
def_gen.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 296 |
+
|
| 297 |
+
def_gen.beta(0.5, 0.5)
|
| 298 |
+
def_gen.beta(0.5, 0.5, size=None)
|
| 299 |
+
def_gen.beta(0.5, 0.5, size=1)
|
| 300 |
+
def_gen.beta(D_arr_0p5, 0.5)
|
| 301 |
+
def_gen.beta(0.5, D_arr_0p5)
|
| 302 |
+
def_gen.beta(D_arr_0p5, 0.5, size=1)
|
| 303 |
+
def_gen.beta(0.5, D_arr_0p5, size=1)
|
| 304 |
+
def_gen.beta(D_arr_like_0p5, 0.5)
|
| 305 |
+
def_gen.beta(0.5, D_arr_like_0p5)
|
| 306 |
+
def_gen.beta(D_arr_0p5, D_arr_0p5)
|
| 307 |
+
def_gen.beta(D_arr_like_0p5, D_arr_like_0p5)
|
| 308 |
+
def_gen.beta(D_arr_0p5, D_arr_0p5, size=1)
|
| 309 |
+
def_gen.beta(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 310 |
+
|
| 311 |
+
def_gen.f(0.5, 0.5)
|
| 312 |
+
def_gen.f(0.5, 0.5, size=None)
|
| 313 |
+
def_gen.f(0.5, 0.5, size=1)
|
| 314 |
+
def_gen.f(D_arr_0p5, 0.5)
|
| 315 |
+
def_gen.f(0.5, D_arr_0p5)
|
| 316 |
+
def_gen.f(D_arr_0p5, 0.5, size=1)
|
| 317 |
+
def_gen.f(0.5, D_arr_0p5, size=1)
|
| 318 |
+
def_gen.f(D_arr_like_0p5, 0.5)
|
| 319 |
+
def_gen.f(0.5, D_arr_like_0p5)
|
| 320 |
+
def_gen.f(D_arr_0p5, D_arr_0p5)
|
| 321 |
+
def_gen.f(D_arr_like_0p5, D_arr_like_0p5)
|
| 322 |
+
def_gen.f(D_arr_0p5, D_arr_0p5, size=1)
|
| 323 |
+
def_gen.f(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 324 |
+
|
| 325 |
+
def_gen.gamma(0.5, 0.5)
|
| 326 |
+
def_gen.gamma(0.5, 0.5, size=None)
|
| 327 |
+
def_gen.gamma(0.5, 0.5, size=1)
|
| 328 |
+
def_gen.gamma(D_arr_0p5, 0.5)
|
| 329 |
+
def_gen.gamma(0.5, D_arr_0p5)
|
| 330 |
+
def_gen.gamma(D_arr_0p5, 0.5, size=1)
|
| 331 |
+
def_gen.gamma(0.5, D_arr_0p5, size=1)
|
| 332 |
+
def_gen.gamma(D_arr_like_0p5, 0.5)
|
| 333 |
+
def_gen.gamma(0.5, D_arr_like_0p5)
|
| 334 |
+
def_gen.gamma(D_arr_0p5, D_arr_0p5)
|
| 335 |
+
def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5)
|
| 336 |
+
def_gen.gamma(D_arr_0p5, D_arr_0p5, size=1)
|
| 337 |
+
def_gen.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 338 |
+
|
| 339 |
+
def_gen.gumbel(0.5, 0.5)
|
| 340 |
+
def_gen.gumbel(0.5, 0.5, size=None)
|
| 341 |
+
def_gen.gumbel(0.5, 0.5, size=1)
|
| 342 |
+
def_gen.gumbel(D_arr_0p5, 0.5)
|
| 343 |
+
def_gen.gumbel(0.5, D_arr_0p5)
|
| 344 |
+
def_gen.gumbel(D_arr_0p5, 0.5, size=1)
|
| 345 |
+
def_gen.gumbel(0.5, D_arr_0p5, size=1)
|
| 346 |
+
def_gen.gumbel(D_arr_like_0p5, 0.5)
|
| 347 |
+
def_gen.gumbel(0.5, D_arr_like_0p5)
|
| 348 |
+
def_gen.gumbel(D_arr_0p5, D_arr_0p5)
|
| 349 |
+
def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5)
|
| 350 |
+
def_gen.gumbel(D_arr_0p5, D_arr_0p5, size=1)
|
| 351 |
+
def_gen.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 352 |
+
|
| 353 |
+
def_gen.laplace(0.5, 0.5)
|
| 354 |
+
def_gen.laplace(0.5, 0.5, size=None)
|
| 355 |
+
def_gen.laplace(0.5, 0.5, size=1)
|
| 356 |
+
def_gen.laplace(D_arr_0p5, 0.5)
|
| 357 |
+
def_gen.laplace(0.5, D_arr_0p5)
|
| 358 |
+
def_gen.laplace(D_arr_0p5, 0.5, size=1)
|
| 359 |
+
def_gen.laplace(0.5, D_arr_0p5, size=1)
|
| 360 |
+
def_gen.laplace(D_arr_like_0p5, 0.5)
|
| 361 |
+
def_gen.laplace(0.5, D_arr_like_0p5)
|
| 362 |
+
def_gen.laplace(D_arr_0p5, D_arr_0p5)
|
| 363 |
+
def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5)
|
| 364 |
+
def_gen.laplace(D_arr_0p5, D_arr_0p5, size=1)
|
| 365 |
+
def_gen.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 366 |
+
|
| 367 |
+
def_gen.logistic(0.5, 0.5)
|
| 368 |
+
def_gen.logistic(0.5, 0.5, size=None)
|
| 369 |
+
def_gen.logistic(0.5, 0.5, size=1)
|
| 370 |
+
def_gen.logistic(D_arr_0p5, 0.5)
|
| 371 |
+
def_gen.logistic(0.5, D_arr_0p5)
|
| 372 |
+
def_gen.logistic(D_arr_0p5, 0.5, size=1)
|
| 373 |
+
def_gen.logistic(0.5, D_arr_0p5, size=1)
|
| 374 |
+
def_gen.logistic(D_arr_like_0p5, 0.5)
|
| 375 |
+
def_gen.logistic(0.5, D_arr_like_0p5)
|
| 376 |
+
def_gen.logistic(D_arr_0p5, D_arr_0p5)
|
| 377 |
+
def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5)
|
| 378 |
+
def_gen.logistic(D_arr_0p5, D_arr_0p5, size=1)
|
| 379 |
+
def_gen.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 380 |
+
|
| 381 |
+
def_gen.lognormal(0.5, 0.5)
|
| 382 |
+
def_gen.lognormal(0.5, 0.5, size=None)
|
| 383 |
+
def_gen.lognormal(0.5, 0.5, size=1)
|
| 384 |
+
def_gen.lognormal(D_arr_0p5, 0.5)
|
| 385 |
+
def_gen.lognormal(0.5, D_arr_0p5)
|
| 386 |
+
def_gen.lognormal(D_arr_0p5, 0.5, size=1)
|
| 387 |
+
def_gen.lognormal(0.5, D_arr_0p5, size=1)
|
| 388 |
+
def_gen.lognormal(D_arr_like_0p5, 0.5)
|
| 389 |
+
def_gen.lognormal(0.5, D_arr_like_0p5)
|
| 390 |
+
def_gen.lognormal(D_arr_0p5, D_arr_0p5)
|
| 391 |
+
def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5)
|
| 392 |
+
def_gen.lognormal(D_arr_0p5, D_arr_0p5, size=1)
|
| 393 |
+
def_gen.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 394 |
+
|
| 395 |
+
def_gen.noncentral_chisquare(0.5, 0.5)
|
| 396 |
+
def_gen.noncentral_chisquare(0.5, 0.5, size=None)
|
| 397 |
+
def_gen.noncentral_chisquare(0.5, 0.5, size=1)
|
| 398 |
+
def_gen.noncentral_chisquare(D_arr_0p5, 0.5)
|
| 399 |
+
def_gen.noncentral_chisquare(0.5, D_arr_0p5)
|
| 400 |
+
def_gen.noncentral_chisquare(D_arr_0p5, 0.5, size=1)
|
| 401 |
+
def_gen.noncentral_chisquare(0.5, D_arr_0p5, size=1)
|
| 402 |
+
def_gen.noncentral_chisquare(D_arr_like_0p5, 0.5)
|
| 403 |
+
def_gen.noncentral_chisquare(0.5, D_arr_like_0p5)
|
| 404 |
+
def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5)
|
| 405 |
+
def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5)
|
| 406 |
+
def_gen.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1)
|
| 407 |
+
def_gen.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 408 |
+
|
| 409 |
+
def_gen.normal(0.5, 0.5)
|
| 410 |
+
def_gen.normal(0.5, 0.5, size=None)
|
| 411 |
+
def_gen.normal(0.5, 0.5, size=1)
|
| 412 |
+
def_gen.normal(D_arr_0p5, 0.5)
|
| 413 |
+
def_gen.normal(0.5, D_arr_0p5)
|
| 414 |
+
def_gen.normal(D_arr_0p5, 0.5, size=1)
|
| 415 |
+
def_gen.normal(0.5, D_arr_0p5, size=1)
|
| 416 |
+
def_gen.normal(D_arr_like_0p5, 0.5)
|
| 417 |
+
def_gen.normal(0.5, D_arr_like_0p5)
|
| 418 |
+
def_gen.normal(D_arr_0p5, D_arr_0p5)
|
| 419 |
+
def_gen.normal(D_arr_like_0p5, D_arr_like_0p5)
|
| 420 |
+
def_gen.normal(D_arr_0p5, D_arr_0p5, size=1)
|
| 421 |
+
def_gen.normal(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 422 |
+
|
| 423 |
+
def_gen.triangular(0.1, 0.5, 0.9)
|
| 424 |
+
def_gen.triangular(0.1, 0.5, 0.9, size=None)
|
| 425 |
+
def_gen.triangular(0.1, 0.5, 0.9, size=1)
|
| 426 |
+
def_gen.triangular(D_arr_0p1, 0.5, 0.9)
|
| 427 |
+
def_gen.triangular(0.1, D_arr_0p5, 0.9)
|
| 428 |
+
def_gen.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)
|
| 429 |
+
def_gen.triangular(0.1, D_arr_0p5, 0.9, size=1)
|
| 430 |
+
def_gen.triangular(D_arr_like_0p1, 0.5, D_arr_0p9)
|
| 431 |
+
def_gen.triangular(0.5, D_arr_like_0p5, 0.9)
|
| 432 |
+
def_gen.triangular(D_arr_0p1, D_arr_0p5, 0.9)
|
| 433 |
+
def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9)
|
| 434 |
+
def_gen.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)
|
| 435 |
+
def_gen.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)
|
| 436 |
+
|
| 437 |
+
def_gen.noncentral_f(0.1, 0.5, 0.9)
|
| 438 |
+
def_gen.noncentral_f(0.1, 0.5, 0.9, size=None)
|
| 439 |
+
def_gen.noncentral_f(0.1, 0.5, 0.9, size=1)
|
| 440 |
+
def_gen.noncentral_f(D_arr_0p1, 0.5, 0.9)
|
| 441 |
+
def_gen.noncentral_f(0.1, D_arr_0p5, 0.9)
|
| 442 |
+
def_gen.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)
|
| 443 |
+
def_gen.noncentral_f(0.1, D_arr_0p5, 0.9, size=1)
|
| 444 |
+
def_gen.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9)
|
| 445 |
+
def_gen.noncentral_f(0.5, D_arr_like_0p5, 0.9)
|
| 446 |
+
def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9)
|
| 447 |
+
def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9)
|
| 448 |
+
def_gen.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)
|
| 449 |
+
def_gen.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)
|
| 450 |
+
|
| 451 |
+
def_gen.binomial(10, 0.5)
|
| 452 |
+
def_gen.binomial(10, 0.5, size=None)
|
| 453 |
+
def_gen.binomial(10, 0.5, size=1)
|
| 454 |
+
def_gen.binomial(I_arr_10, 0.5)
|
| 455 |
+
def_gen.binomial(10, D_arr_0p5)
|
| 456 |
+
def_gen.binomial(I_arr_10, 0.5, size=1)
|
| 457 |
+
def_gen.binomial(10, D_arr_0p5, size=1)
|
| 458 |
+
def_gen.binomial(I_arr_like_10, 0.5)
|
| 459 |
+
def_gen.binomial(10, D_arr_like_0p5)
|
| 460 |
+
def_gen.binomial(I_arr_10, D_arr_0p5)
|
| 461 |
+
def_gen.binomial(I_arr_like_10, D_arr_like_0p5)
|
| 462 |
+
def_gen.binomial(I_arr_10, D_arr_0p5, size=1)
|
| 463 |
+
def_gen.binomial(I_arr_like_10, D_arr_like_0p5, size=1)
|
| 464 |
+
|
| 465 |
+
def_gen.negative_binomial(10, 0.5)
|
| 466 |
+
def_gen.negative_binomial(10, 0.5, size=None)
|
| 467 |
+
def_gen.negative_binomial(10, 0.5, size=1)
|
| 468 |
+
def_gen.negative_binomial(I_arr_10, 0.5)
|
| 469 |
+
def_gen.negative_binomial(10, D_arr_0p5)
|
| 470 |
+
def_gen.negative_binomial(I_arr_10, 0.5, size=1)
|
| 471 |
+
def_gen.negative_binomial(10, D_arr_0p5, size=1)
|
| 472 |
+
def_gen.negative_binomial(I_arr_like_10, 0.5)
|
| 473 |
+
def_gen.negative_binomial(10, D_arr_like_0p5)
|
| 474 |
+
def_gen.negative_binomial(I_arr_10, D_arr_0p5)
|
| 475 |
+
def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5)
|
| 476 |
+
def_gen.negative_binomial(I_arr_10, D_arr_0p5, size=1)
|
| 477 |
+
def_gen.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1)
|
| 478 |
+
|
| 479 |
+
def_gen.hypergeometric(20, 20, 10)
|
| 480 |
+
def_gen.hypergeometric(20, 20, 10, size=None)
|
| 481 |
+
def_gen.hypergeometric(20, 20, 10, size=1)
|
| 482 |
+
def_gen.hypergeometric(I_arr_20, 20, 10)
|
| 483 |
+
def_gen.hypergeometric(20, I_arr_20, 10)
|
| 484 |
+
def_gen.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1)
|
| 485 |
+
def_gen.hypergeometric(20, I_arr_20, 10, size=1)
|
| 486 |
+
def_gen.hypergeometric(I_arr_like_20, 20, I_arr_10)
|
| 487 |
+
def_gen.hypergeometric(20, I_arr_like_20, 10)
|
| 488 |
+
def_gen.hypergeometric(I_arr_20, I_arr_20, 10)
|
| 489 |
+
def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, 10)
|
| 490 |
+
def_gen.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1)
|
| 491 |
+
def_gen.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1)
|
| 492 |
+
|
| 493 |
+
I_int64_100: np.ndarray[Any, np.dtype[np.int64]] = np.array([100], dtype=np.int64)
|
| 494 |
+
|
| 495 |
+
def_gen.integers(0, 100)
|
| 496 |
+
def_gen.integers(100)
|
| 497 |
+
def_gen.integers([100])
|
| 498 |
+
def_gen.integers(0, [100])
|
| 499 |
+
|
| 500 |
+
I_bool_low: np.ndarray[Any, np.dtype[np.bool_]] = np.array([0], dtype=np.bool_)
|
| 501 |
+
I_bool_low_like: list[int] = [0]
|
| 502 |
+
I_bool_high_open: np.ndarray[Any, np.dtype[np.bool_]] = np.array([1], dtype=np.bool_)
|
| 503 |
+
I_bool_high_closed: np.ndarray[Any, np.dtype[np.bool_]] = np.array([1], dtype=np.bool_)
|
| 504 |
+
|
| 505 |
+
def_gen.integers(2, dtype=bool)
|
| 506 |
+
def_gen.integers(0, 2, dtype=bool)
|
| 507 |
+
def_gen.integers(1, dtype=bool, endpoint=True)
|
| 508 |
+
def_gen.integers(0, 1, dtype=bool, endpoint=True)
|
| 509 |
+
def_gen.integers(I_bool_low_like, 1, dtype=bool, endpoint=True)
|
| 510 |
+
def_gen.integers(I_bool_high_open, dtype=bool)
|
| 511 |
+
def_gen.integers(I_bool_low, I_bool_high_open, dtype=bool)
|
| 512 |
+
def_gen.integers(0, I_bool_high_open, dtype=bool)
|
| 513 |
+
def_gen.integers(I_bool_high_closed, dtype=bool, endpoint=True)
|
| 514 |
+
def_gen.integers(I_bool_low, I_bool_high_closed, dtype=bool, endpoint=True)
|
| 515 |
+
def_gen.integers(0, I_bool_high_closed, dtype=bool, endpoint=True)
|
| 516 |
+
|
| 517 |
+
def_gen.integers(2, dtype=np.bool_)
|
| 518 |
+
def_gen.integers(0, 2, dtype=np.bool_)
|
| 519 |
+
def_gen.integers(1, dtype=np.bool_, endpoint=True)
|
| 520 |
+
def_gen.integers(0, 1, dtype=np.bool_, endpoint=True)
|
| 521 |
+
def_gen.integers(I_bool_low_like, 1, dtype=np.bool_, endpoint=True)
|
| 522 |
+
def_gen.integers(I_bool_high_open, dtype=np.bool_)
|
| 523 |
+
def_gen.integers(I_bool_low, I_bool_high_open, dtype=np.bool_)
|
| 524 |
+
def_gen.integers(0, I_bool_high_open, dtype=np.bool_)
|
| 525 |
+
def_gen.integers(I_bool_high_closed, dtype=np.bool_, endpoint=True)
|
| 526 |
+
def_gen.integers(I_bool_low, I_bool_high_closed, dtype=np.bool_, endpoint=True)
|
| 527 |
+
def_gen.integers(0, I_bool_high_closed, dtype=np.bool_, endpoint=True)
|
| 528 |
+
|
| 529 |
+
I_u1_low: np.ndarray[Any, np.dtype[np.uint8]] = np.array([0], dtype=np.uint8)
|
| 530 |
+
I_u1_low_like: list[int] = [0]
|
| 531 |
+
I_u1_high_open: np.ndarray[Any, np.dtype[np.uint8]] = np.array([255], dtype=np.uint8)
|
| 532 |
+
I_u1_high_closed: np.ndarray[Any, np.dtype[np.uint8]] = np.array([255], dtype=np.uint8)
|
| 533 |
+
|
| 534 |
+
def_gen.integers(256, dtype="u1")
|
| 535 |
+
def_gen.integers(0, 256, dtype="u1")
|
| 536 |
+
def_gen.integers(255, dtype="u1", endpoint=True)
|
| 537 |
+
def_gen.integers(0, 255, dtype="u1", endpoint=True)
|
| 538 |
+
def_gen.integers(I_u1_low_like, 255, dtype="u1", endpoint=True)
|
| 539 |
+
def_gen.integers(I_u1_high_open, dtype="u1")
|
| 540 |
+
def_gen.integers(I_u1_low, I_u1_high_open, dtype="u1")
|
| 541 |
+
def_gen.integers(0, I_u1_high_open, dtype="u1")
|
| 542 |
+
def_gen.integers(I_u1_high_closed, dtype="u1", endpoint=True)
|
| 543 |
+
def_gen.integers(I_u1_low, I_u1_high_closed, dtype="u1", endpoint=True)
|
| 544 |
+
def_gen.integers(0, I_u1_high_closed, dtype="u1", endpoint=True)
|
| 545 |
+
|
| 546 |
+
def_gen.integers(256, dtype="uint8")
|
| 547 |
+
def_gen.integers(0, 256, dtype="uint8")
|
| 548 |
+
def_gen.integers(255, dtype="uint8", endpoint=True)
|
| 549 |
+
def_gen.integers(0, 255, dtype="uint8", endpoint=True)
|
| 550 |
+
def_gen.integers(I_u1_low_like, 255, dtype="uint8", endpoint=True)
|
| 551 |
+
def_gen.integers(I_u1_high_open, dtype="uint8")
|
| 552 |
+
def_gen.integers(I_u1_low, I_u1_high_open, dtype="uint8")
|
| 553 |
+
def_gen.integers(0, I_u1_high_open, dtype="uint8")
|
| 554 |
+
def_gen.integers(I_u1_high_closed, dtype="uint8", endpoint=True)
|
| 555 |
+
def_gen.integers(I_u1_low, I_u1_high_closed, dtype="uint8", endpoint=True)
|
| 556 |
+
def_gen.integers(0, I_u1_high_closed, dtype="uint8", endpoint=True)
|
| 557 |
+
|
| 558 |
+
def_gen.integers(256, dtype=np.uint8)
|
| 559 |
+
def_gen.integers(0, 256, dtype=np.uint8)
|
| 560 |
+
def_gen.integers(255, dtype=np.uint8, endpoint=True)
|
| 561 |
+
def_gen.integers(0, 255, dtype=np.uint8, endpoint=True)
|
| 562 |
+
def_gen.integers(I_u1_low_like, 255, dtype=np.uint8, endpoint=True)
|
| 563 |
+
def_gen.integers(I_u1_high_open, dtype=np.uint8)
|
| 564 |
+
def_gen.integers(I_u1_low, I_u1_high_open, dtype=np.uint8)
|
| 565 |
+
def_gen.integers(0, I_u1_high_open, dtype=np.uint8)
|
| 566 |
+
def_gen.integers(I_u1_high_closed, dtype=np.uint8, endpoint=True)
|
| 567 |
+
def_gen.integers(I_u1_low, I_u1_high_closed, dtype=np.uint8, endpoint=True)
|
| 568 |
+
def_gen.integers(0, I_u1_high_closed, dtype=np.uint8, endpoint=True)
|
| 569 |
+
|
| 570 |
+
I_u2_low: np.ndarray[Any, np.dtype[np.uint16]] = np.array([0], dtype=np.uint16)
|
| 571 |
+
I_u2_low_like: list[int] = [0]
|
| 572 |
+
I_u2_high_open: np.ndarray[Any, np.dtype[np.uint16]] = np.array([65535], dtype=np.uint16)
|
| 573 |
+
I_u2_high_closed: np.ndarray[Any, np.dtype[np.uint16]] = np.array([65535], dtype=np.uint16)
|
| 574 |
+
|
| 575 |
+
def_gen.integers(65536, dtype="u2")
|
| 576 |
+
def_gen.integers(0, 65536, dtype="u2")
|
| 577 |
+
def_gen.integers(65535, dtype="u2", endpoint=True)
|
| 578 |
+
def_gen.integers(0, 65535, dtype="u2", endpoint=True)
|
| 579 |
+
def_gen.integers(I_u2_low_like, 65535, dtype="u2", endpoint=True)
|
| 580 |
+
def_gen.integers(I_u2_high_open, dtype="u2")
|
| 581 |
+
def_gen.integers(I_u2_low, I_u2_high_open, dtype="u2")
|
| 582 |
+
def_gen.integers(0, I_u2_high_open, dtype="u2")
|
| 583 |
+
def_gen.integers(I_u2_high_closed, dtype="u2", endpoint=True)
|
| 584 |
+
def_gen.integers(I_u2_low, I_u2_high_closed, dtype="u2", endpoint=True)
|
| 585 |
+
def_gen.integers(0, I_u2_high_closed, dtype="u2", endpoint=True)
|
| 586 |
+
|
| 587 |
+
def_gen.integers(65536, dtype="uint16")
|
| 588 |
+
def_gen.integers(0, 65536, dtype="uint16")
|
| 589 |
+
def_gen.integers(65535, dtype="uint16", endpoint=True)
|
| 590 |
+
def_gen.integers(0, 65535, dtype="uint16", endpoint=True)
|
| 591 |
+
def_gen.integers(I_u2_low_like, 65535, dtype="uint16", endpoint=True)
|
| 592 |
+
def_gen.integers(I_u2_high_open, dtype="uint16")
|
| 593 |
+
def_gen.integers(I_u2_low, I_u2_high_open, dtype="uint16")
|
| 594 |
+
def_gen.integers(0, I_u2_high_open, dtype="uint16")
|
| 595 |
+
def_gen.integers(I_u2_high_closed, dtype="uint16", endpoint=True)
|
| 596 |
+
def_gen.integers(I_u2_low, I_u2_high_closed, dtype="uint16", endpoint=True)
|
| 597 |
+
def_gen.integers(0, I_u2_high_closed, dtype="uint16", endpoint=True)
|
| 598 |
+
|
| 599 |
+
def_gen.integers(65536, dtype=np.uint16)
|
| 600 |
+
def_gen.integers(0, 65536, dtype=np.uint16)
|
| 601 |
+
def_gen.integers(65535, dtype=np.uint16, endpoint=True)
|
| 602 |
+
def_gen.integers(0, 65535, dtype=np.uint16, endpoint=True)
|
| 603 |
+
def_gen.integers(I_u2_low_like, 65535, dtype=np.uint16, endpoint=True)
|
| 604 |
+
def_gen.integers(I_u2_high_open, dtype=np.uint16)
|
| 605 |
+
def_gen.integers(I_u2_low, I_u2_high_open, dtype=np.uint16)
|
| 606 |
+
def_gen.integers(0, I_u2_high_open, dtype=np.uint16)
|
| 607 |
+
def_gen.integers(I_u2_high_closed, dtype=np.uint16, endpoint=True)
|
| 608 |
+
def_gen.integers(I_u2_low, I_u2_high_closed, dtype=np.uint16, endpoint=True)
|
| 609 |
+
def_gen.integers(0, I_u2_high_closed, dtype=np.uint16, endpoint=True)
|
| 610 |
+
|
| 611 |
+
I_u4_low: np.ndarray[Any, np.dtype[np.uint32]] = np.array([0], dtype=np.uint32)
|
| 612 |
+
I_u4_low_like: list[int] = [0]
|
| 613 |
+
I_u4_high_open: np.ndarray[Any, np.dtype[np.uint32]] = np.array([4294967295], dtype=np.uint32)
|
| 614 |
+
I_u4_high_closed: np.ndarray[Any, np.dtype[np.uint32]] = np.array([4294967295], dtype=np.uint32)
|
| 615 |
+
|
| 616 |
+
def_gen.integers(4294967296, dtype="u4")
|
| 617 |
+
def_gen.integers(0, 4294967296, dtype="u4")
|
| 618 |
+
def_gen.integers(4294967295, dtype="u4", endpoint=True)
|
| 619 |
+
def_gen.integers(0, 4294967295, dtype="u4", endpoint=True)
|
| 620 |
+
def_gen.integers(I_u4_low_like, 4294967295, dtype="u4", endpoint=True)
|
| 621 |
+
def_gen.integers(I_u4_high_open, dtype="u4")
|
| 622 |
+
def_gen.integers(I_u4_low, I_u4_high_open, dtype="u4")
|
| 623 |
+
def_gen.integers(0, I_u4_high_open, dtype="u4")
|
| 624 |
+
def_gen.integers(I_u4_high_closed, dtype="u4", endpoint=True)
|
| 625 |
+
def_gen.integers(I_u4_low, I_u4_high_closed, dtype="u4", endpoint=True)
|
| 626 |
+
def_gen.integers(0, I_u4_high_closed, dtype="u4", endpoint=True)
|
| 627 |
+
|
| 628 |
+
def_gen.integers(4294967296, dtype="uint32")
|
| 629 |
+
def_gen.integers(0, 4294967296, dtype="uint32")
|
| 630 |
+
def_gen.integers(4294967295, dtype="uint32", endpoint=True)
|
| 631 |
+
def_gen.integers(0, 4294967295, dtype="uint32", endpoint=True)
|
| 632 |
+
def_gen.integers(I_u4_low_like, 4294967295, dtype="uint32", endpoint=True)
|
| 633 |
+
def_gen.integers(I_u4_high_open, dtype="uint32")
|
| 634 |
+
def_gen.integers(I_u4_low, I_u4_high_open, dtype="uint32")
|
| 635 |
+
def_gen.integers(0, I_u4_high_open, dtype="uint32")
|
| 636 |
+
def_gen.integers(I_u4_high_closed, dtype="uint32", endpoint=True)
|
| 637 |
+
def_gen.integers(I_u4_low, I_u4_high_closed, dtype="uint32", endpoint=True)
|
| 638 |
+
def_gen.integers(0, I_u4_high_closed, dtype="uint32", endpoint=True)
|
| 639 |
+
|
| 640 |
+
def_gen.integers(4294967296, dtype=np.uint32)
|
| 641 |
+
def_gen.integers(0, 4294967296, dtype=np.uint32)
|
| 642 |
+
def_gen.integers(4294967295, dtype=np.uint32, endpoint=True)
|
| 643 |
+
def_gen.integers(0, 4294967295, dtype=np.uint32, endpoint=True)
|
| 644 |
+
def_gen.integers(I_u4_low_like, 4294967295, dtype=np.uint32, endpoint=True)
|
| 645 |
+
def_gen.integers(I_u4_high_open, dtype=np.uint32)
|
| 646 |
+
def_gen.integers(I_u4_low, I_u4_high_open, dtype=np.uint32)
|
| 647 |
+
def_gen.integers(0, I_u4_high_open, dtype=np.uint32)
|
| 648 |
+
def_gen.integers(I_u4_high_closed, dtype=np.uint32, endpoint=True)
|
| 649 |
+
def_gen.integers(I_u4_low, I_u4_high_closed, dtype=np.uint32, endpoint=True)
|
| 650 |
+
def_gen.integers(0, I_u4_high_closed, dtype=np.uint32, endpoint=True)
|
| 651 |
+
|
| 652 |
+
I_u8_low: np.ndarray[Any, np.dtype[np.uint64]] = np.array([0], dtype=np.uint64)
|
| 653 |
+
I_u8_low_like: list[int] = [0]
|
| 654 |
+
I_u8_high_open: np.ndarray[Any, np.dtype[np.uint64]] = np.array([18446744073709551615], dtype=np.uint64)
|
| 655 |
+
I_u8_high_closed: np.ndarray[Any, np.dtype[np.uint64]] = np.array([18446744073709551615], dtype=np.uint64)
|
| 656 |
+
|
| 657 |
+
def_gen.integers(18446744073709551616, dtype="u8")
|
| 658 |
+
def_gen.integers(0, 18446744073709551616, dtype="u8")
|
| 659 |
+
def_gen.integers(18446744073709551615, dtype="u8", endpoint=True)
|
| 660 |
+
def_gen.integers(0, 18446744073709551615, dtype="u8", endpoint=True)
|
| 661 |
+
def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="u8", endpoint=True)
|
| 662 |
+
def_gen.integers(I_u8_high_open, dtype="u8")
|
| 663 |
+
def_gen.integers(I_u8_low, I_u8_high_open, dtype="u8")
|
| 664 |
+
def_gen.integers(0, I_u8_high_open, dtype="u8")
|
| 665 |
+
def_gen.integers(I_u8_high_closed, dtype="u8", endpoint=True)
|
| 666 |
+
def_gen.integers(I_u8_low, I_u8_high_closed, dtype="u8", endpoint=True)
|
| 667 |
+
def_gen.integers(0, I_u8_high_closed, dtype="u8", endpoint=True)
|
| 668 |
+
|
| 669 |
+
def_gen.integers(18446744073709551616, dtype="uint64")
|
| 670 |
+
def_gen.integers(0, 18446744073709551616, dtype="uint64")
|
| 671 |
+
def_gen.integers(18446744073709551615, dtype="uint64", endpoint=True)
|
| 672 |
+
def_gen.integers(0, 18446744073709551615, dtype="uint64", endpoint=True)
|
| 673 |
+
def_gen.integers(I_u8_low_like, 18446744073709551615, dtype="uint64", endpoint=True)
|
| 674 |
+
def_gen.integers(I_u8_high_open, dtype="uint64")
|
| 675 |
+
def_gen.integers(I_u8_low, I_u8_high_open, dtype="uint64")
|
| 676 |
+
def_gen.integers(0, I_u8_high_open, dtype="uint64")
|
| 677 |
+
def_gen.integers(I_u8_high_closed, dtype="uint64", endpoint=True)
|
| 678 |
+
def_gen.integers(I_u8_low, I_u8_high_closed, dtype="uint64", endpoint=True)
|
| 679 |
+
def_gen.integers(0, I_u8_high_closed, dtype="uint64", endpoint=True)
|
| 680 |
+
|
| 681 |
+
def_gen.integers(18446744073709551616, dtype=np.uint64)
|
| 682 |
+
def_gen.integers(0, 18446744073709551616, dtype=np.uint64)
|
| 683 |
+
def_gen.integers(18446744073709551615, dtype=np.uint64, endpoint=True)
|
| 684 |
+
def_gen.integers(0, 18446744073709551615, dtype=np.uint64, endpoint=True)
|
| 685 |
+
def_gen.integers(I_u8_low_like, 18446744073709551615, dtype=np.uint64, endpoint=True)
|
| 686 |
+
def_gen.integers(I_u8_high_open, dtype=np.uint64)
|
| 687 |
+
def_gen.integers(I_u8_low, I_u8_high_open, dtype=np.uint64)
|
| 688 |
+
def_gen.integers(0, I_u8_high_open, dtype=np.uint64)
|
| 689 |
+
def_gen.integers(I_u8_high_closed, dtype=np.uint64, endpoint=True)
|
| 690 |
+
def_gen.integers(I_u8_low, I_u8_high_closed, dtype=np.uint64, endpoint=True)
|
| 691 |
+
def_gen.integers(0, I_u8_high_closed, dtype=np.uint64, endpoint=True)
|
| 692 |
+
|
| 693 |
+
I_i1_low: np.ndarray[Any, np.dtype[np.int8]] = np.array([-128], dtype=np.int8)
|
| 694 |
+
I_i1_low_like: list[int] = [-128]
|
| 695 |
+
I_i1_high_open: np.ndarray[Any, np.dtype[np.int8]] = np.array([127], dtype=np.int8)
|
| 696 |
+
I_i1_high_closed: np.ndarray[Any, np.dtype[np.int8]] = np.array([127], dtype=np.int8)
|
| 697 |
+
|
| 698 |
+
def_gen.integers(128, dtype="i1")
|
| 699 |
+
def_gen.integers(-128, 128, dtype="i1")
|
| 700 |
+
def_gen.integers(127, dtype="i1", endpoint=True)
|
| 701 |
+
def_gen.integers(-128, 127, dtype="i1", endpoint=True)
|
| 702 |
+
def_gen.integers(I_i1_low_like, 127, dtype="i1", endpoint=True)
|
| 703 |
+
def_gen.integers(I_i1_high_open, dtype="i1")
|
| 704 |
+
def_gen.integers(I_i1_low, I_i1_high_open, dtype="i1")
|
| 705 |
+
def_gen.integers(-128, I_i1_high_open, dtype="i1")
|
| 706 |
+
def_gen.integers(I_i1_high_closed, dtype="i1", endpoint=True)
|
| 707 |
+
def_gen.integers(I_i1_low, I_i1_high_closed, dtype="i1", endpoint=True)
|
| 708 |
+
def_gen.integers(-128, I_i1_high_closed, dtype="i1", endpoint=True)
|
| 709 |
+
|
| 710 |
+
def_gen.integers(128, dtype="int8")
|
| 711 |
+
def_gen.integers(-128, 128, dtype="int8")
|
| 712 |
+
def_gen.integers(127, dtype="int8", endpoint=True)
|
| 713 |
+
def_gen.integers(-128, 127, dtype="int8", endpoint=True)
|
| 714 |
+
def_gen.integers(I_i1_low_like, 127, dtype="int8", endpoint=True)
|
| 715 |
+
def_gen.integers(I_i1_high_open, dtype="int8")
|
| 716 |
+
def_gen.integers(I_i1_low, I_i1_high_open, dtype="int8")
|
| 717 |
+
def_gen.integers(-128, I_i1_high_open, dtype="int8")
|
| 718 |
+
def_gen.integers(I_i1_high_closed, dtype="int8", endpoint=True)
|
| 719 |
+
def_gen.integers(I_i1_low, I_i1_high_closed, dtype="int8", endpoint=True)
|
| 720 |
+
def_gen.integers(-128, I_i1_high_closed, dtype="int8", endpoint=True)
|
| 721 |
+
|
| 722 |
+
def_gen.integers(128, dtype=np.int8)
|
| 723 |
+
def_gen.integers(-128, 128, dtype=np.int8)
|
| 724 |
+
def_gen.integers(127, dtype=np.int8, endpoint=True)
|
| 725 |
+
def_gen.integers(-128, 127, dtype=np.int8, endpoint=True)
|
| 726 |
+
def_gen.integers(I_i1_low_like, 127, dtype=np.int8, endpoint=True)
|
| 727 |
+
def_gen.integers(I_i1_high_open, dtype=np.int8)
|
| 728 |
+
def_gen.integers(I_i1_low, I_i1_high_open, dtype=np.int8)
|
| 729 |
+
def_gen.integers(-128, I_i1_high_open, dtype=np.int8)
|
| 730 |
+
def_gen.integers(I_i1_high_closed, dtype=np.int8, endpoint=True)
|
| 731 |
+
def_gen.integers(I_i1_low, I_i1_high_closed, dtype=np.int8, endpoint=True)
|
| 732 |
+
def_gen.integers(-128, I_i1_high_closed, dtype=np.int8, endpoint=True)
|
| 733 |
+
|
| 734 |
+
I_i2_low: np.ndarray[Any, np.dtype[np.int16]] = np.array([-32768], dtype=np.int16)
|
| 735 |
+
I_i2_low_like: list[int] = [-32768]
|
| 736 |
+
I_i2_high_open: np.ndarray[Any, np.dtype[np.int16]] = np.array([32767], dtype=np.int16)
|
| 737 |
+
I_i2_high_closed: np.ndarray[Any, np.dtype[np.int16]] = np.array([32767], dtype=np.int16)
|
| 738 |
+
|
| 739 |
+
def_gen.integers(32768, dtype="i2")
|
| 740 |
+
def_gen.integers(-32768, 32768, dtype="i2")
|
| 741 |
+
def_gen.integers(32767, dtype="i2", endpoint=True)
|
| 742 |
+
def_gen.integers(-32768, 32767, dtype="i2", endpoint=True)
|
| 743 |
+
def_gen.integers(I_i2_low_like, 32767, dtype="i2", endpoint=True)
|
| 744 |
+
def_gen.integers(I_i2_high_open, dtype="i2")
|
| 745 |
+
def_gen.integers(I_i2_low, I_i2_high_open, dtype="i2")
|
| 746 |
+
def_gen.integers(-32768, I_i2_high_open, dtype="i2")
|
| 747 |
+
def_gen.integers(I_i2_high_closed, dtype="i2", endpoint=True)
|
| 748 |
+
def_gen.integers(I_i2_low, I_i2_high_closed, dtype="i2", endpoint=True)
|
| 749 |
+
def_gen.integers(-32768, I_i2_high_closed, dtype="i2", endpoint=True)
|
| 750 |
+
|
| 751 |
+
def_gen.integers(32768, dtype="int16")
|
| 752 |
+
def_gen.integers(-32768, 32768, dtype="int16")
|
| 753 |
+
def_gen.integers(32767, dtype="int16", endpoint=True)
|
| 754 |
+
def_gen.integers(-32768, 32767, dtype="int16", endpoint=True)
|
| 755 |
+
def_gen.integers(I_i2_low_like, 32767, dtype="int16", endpoint=True)
|
| 756 |
+
def_gen.integers(I_i2_high_open, dtype="int16")
|
| 757 |
+
def_gen.integers(I_i2_low, I_i2_high_open, dtype="int16")
|
| 758 |
+
def_gen.integers(-32768, I_i2_high_open, dtype="int16")
|
| 759 |
+
def_gen.integers(I_i2_high_closed, dtype="int16", endpoint=True)
|
| 760 |
+
def_gen.integers(I_i2_low, I_i2_high_closed, dtype="int16", endpoint=True)
|
| 761 |
+
def_gen.integers(-32768, I_i2_high_closed, dtype="int16", endpoint=True)
|
| 762 |
+
|
| 763 |
+
def_gen.integers(32768, dtype=np.int16)
|
| 764 |
+
def_gen.integers(-32768, 32768, dtype=np.int16)
|
| 765 |
+
def_gen.integers(32767, dtype=np.int16, endpoint=True)
|
| 766 |
+
def_gen.integers(-32768, 32767, dtype=np.int16, endpoint=True)
|
| 767 |
+
def_gen.integers(I_i2_low_like, 32767, dtype=np.int16, endpoint=True)
|
| 768 |
+
def_gen.integers(I_i2_high_open, dtype=np.int16)
|
| 769 |
+
def_gen.integers(I_i2_low, I_i2_high_open, dtype=np.int16)
|
| 770 |
+
def_gen.integers(-32768, I_i2_high_open, dtype=np.int16)
|
| 771 |
+
def_gen.integers(I_i2_high_closed, dtype=np.int16, endpoint=True)
|
| 772 |
+
def_gen.integers(I_i2_low, I_i2_high_closed, dtype=np.int16, endpoint=True)
|
| 773 |
+
def_gen.integers(-32768, I_i2_high_closed, dtype=np.int16, endpoint=True)
|
| 774 |
+
|
| 775 |
+
I_i4_low: np.ndarray[Any, np.dtype[np.int32]] = np.array([-2147483648], dtype=np.int32)
|
| 776 |
+
I_i4_low_like: list[int] = [-2147483648]
|
| 777 |
+
I_i4_high_open: np.ndarray[Any, np.dtype[np.int32]] = np.array([2147483647], dtype=np.int32)
|
| 778 |
+
I_i4_high_closed: np.ndarray[Any, np.dtype[np.int32]] = np.array([2147483647], dtype=np.int32)
|
| 779 |
+
|
| 780 |
+
def_gen.integers(2147483648, dtype="i4")
|
| 781 |
+
def_gen.integers(-2147483648, 2147483648, dtype="i4")
|
| 782 |
+
def_gen.integers(2147483647, dtype="i4", endpoint=True)
|
| 783 |
+
def_gen.integers(-2147483648, 2147483647, dtype="i4", endpoint=True)
|
| 784 |
+
def_gen.integers(I_i4_low_like, 2147483647, dtype="i4", endpoint=True)
|
| 785 |
+
def_gen.integers(I_i4_high_open, dtype="i4")
|
| 786 |
+
def_gen.integers(I_i4_low, I_i4_high_open, dtype="i4")
|
| 787 |
+
def_gen.integers(-2147483648, I_i4_high_open, dtype="i4")
|
| 788 |
+
def_gen.integers(I_i4_high_closed, dtype="i4", endpoint=True)
|
| 789 |
+
def_gen.integers(I_i4_low, I_i4_high_closed, dtype="i4", endpoint=True)
|
| 790 |
+
def_gen.integers(-2147483648, I_i4_high_closed, dtype="i4", endpoint=True)
|
| 791 |
+
|
| 792 |
+
def_gen.integers(2147483648, dtype="int32")
|
| 793 |
+
def_gen.integers(-2147483648, 2147483648, dtype="int32")
|
| 794 |
+
def_gen.integers(2147483647, dtype="int32", endpoint=True)
|
| 795 |
+
def_gen.integers(-2147483648, 2147483647, dtype="int32", endpoint=True)
|
| 796 |
+
def_gen.integers(I_i4_low_like, 2147483647, dtype="int32", endpoint=True)
|
| 797 |
+
def_gen.integers(I_i4_high_open, dtype="int32")
|
| 798 |
+
def_gen.integers(I_i4_low, I_i4_high_open, dtype="int32")
|
| 799 |
+
def_gen.integers(-2147483648, I_i4_high_open, dtype="int32")
|
| 800 |
+
def_gen.integers(I_i4_high_closed, dtype="int32", endpoint=True)
|
| 801 |
+
def_gen.integers(I_i4_low, I_i4_high_closed, dtype="int32", endpoint=True)
|
| 802 |
+
def_gen.integers(-2147483648, I_i4_high_closed, dtype="int32", endpoint=True)
|
| 803 |
+
|
| 804 |
+
def_gen.integers(2147483648, dtype=np.int32)
|
| 805 |
+
def_gen.integers(-2147483648, 2147483648, dtype=np.int32)
|
| 806 |
+
def_gen.integers(2147483647, dtype=np.int32, endpoint=True)
|
| 807 |
+
def_gen.integers(-2147483648, 2147483647, dtype=np.int32, endpoint=True)
|
| 808 |
+
def_gen.integers(I_i4_low_like, 2147483647, dtype=np.int32, endpoint=True)
|
| 809 |
+
def_gen.integers(I_i4_high_open, dtype=np.int32)
|
| 810 |
+
def_gen.integers(I_i4_low, I_i4_high_open, dtype=np.int32)
|
| 811 |
+
def_gen.integers(-2147483648, I_i4_high_open, dtype=np.int32)
|
| 812 |
+
def_gen.integers(I_i4_high_closed, dtype=np.int32, endpoint=True)
|
| 813 |
+
def_gen.integers(I_i4_low, I_i4_high_closed, dtype=np.int32, endpoint=True)
|
| 814 |
+
def_gen.integers(-2147483648, I_i4_high_closed, dtype=np.int32, endpoint=True)
|
| 815 |
+
|
| 816 |
+
I_i8_low: np.ndarray[Any, np.dtype[np.int64]] = np.array([-9223372036854775808], dtype=np.int64)
|
| 817 |
+
I_i8_low_like: list[int] = [-9223372036854775808]
|
| 818 |
+
I_i8_high_open: np.ndarray[Any, np.dtype[np.int64]] = np.array([9223372036854775807], dtype=np.int64)
|
| 819 |
+
I_i8_high_closed: np.ndarray[Any, np.dtype[np.int64]] = np.array([9223372036854775807], dtype=np.int64)
|
| 820 |
+
|
| 821 |
+
def_gen.integers(9223372036854775808, dtype="i8")
|
| 822 |
+
def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="i8")
|
| 823 |
+
def_gen.integers(9223372036854775807, dtype="i8", endpoint=True)
|
| 824 |
+
def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="i8", endpoint=True)
|
| 825 |
+
def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="i8", endpoint=True)
|
| 826 |
+
def_gen.integers(I_i8_high_open, dtype="i8")
|
| 827 |
+
def_gen.integers(I_i8_low, I_i8_high_open, dtype="i8")
|
| 828 |
+
def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="i8")
|
| 829 |
+
def_gen.integers(I_i8_high_closed, dtype="i8", endpoint=True)
|
| 830 |
+
def_gen.integers(I_i8_low, I_i8_high_closed, dtype="i8", endpoint=True)
|
| 831 |
+
def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="i8", endpoint=True)
|
| 832 |
+
|
| 833 |
+
def_gen.integers(9223372036854775808, dtype="int64")
|
| 834 |
+
def_gen.integers(-9223372036854775808, 9223372036854775808, dtype="int64")
|
| 835 |
+
def_gen.integers(9223372036854775807, dtype="int64", endpoint=True)
|
| 836 |
+
def_gen.integers(-9223372036854775808, 9223372036854775807, dtype="int64", endpoint=True)
|
| 837 |
+
def_gen.integers(I_i8_low_like, 9223372036854775807, dtype="int64", endpoint=True)
|
| 838 |
+
def_gen.integers(I_i8_high_open, dtype="int64")
|
| 839 |
+
def_gen.integers(I_i8_low, I_i8_high_open, dtype="int64")
|
| 840 |
+
def_gen.integers(-9223372036854775808, I_i8_high_open, dtype="int64")
|
| 841 |
+
def_gen.integers(I_i8_high_closed, dtype="int64", endpoint=True)
|
| 842 |
+
def_gen.integers(I_i8_low, I_i8_high_closed, dtype="int64", endpoint=True)
|
| 843 |
+
def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype="int64", endpoint=True)
|
| 844 |
+
|
| 845 |
+
def_gen.integers(9223372036854775808, dtype=np.int64)
|
| 846 |
+
def_gen.integers(-9223372036854775808, 9223372036854775808, dtype=np.int64)
|
| 847 |
+
def_gen.integers(9223372036854775807, dtype=np.int64, endpoint=True)
|
| 848 |
+
def_gen.integers(-9223372036854775808, 9223372036854775807, dtype=np.int64, endpoint=True)
|
| 849 |
+
def_gen.integers(I_i8_low_like, 9223372036854775807, dtype=np.int64, endpoint=True)
|
| 850 |
+
def_gen.integers(I_i8_high_open, dtype=np.int64)
|
| 851 |
+
def_gen.integers(I_i8_low, I_i8_high_open, dtype=np.int64)
|
| 852 |
+
def_gen.integers(-9223372036854775808, I_i8_high_open, dtype=np.int64)
|
| 853 |
+
def_gen.integers(I_i8_high_closed, dtype=np.int64, endpoint=True)
|
| 854 |
+
def_gen.integers(I_i8_low, I_i8_high_closed, dtype=np.int64, endpoint=True)
|
| 855 |
+
def_gen.integers(-9223372036854775808, I_i8_high_closed, dtype=np.int64, endpoint=True)
|
| 856 |
+
|
| 857 |
+
|
| 858 |
+
def_gen.bit_generator
|
| 859 |
+
|
| 860 |
+
def_gen.bytes(2)
|
| 861 |
+
|
| 862 |
+
def_gen.choice(5)
|
| 863 |
+
def_gen.choice(5, 3)
|
| 864 |
+
def_gen.choice(5, 3, replace=True)
|
| 865 |
+
def_gen.choice(5, 3, p=[1 / 5] * 5)
|
| 866 |
+
def_gen.choice(5, 3, p=[1 / 5] * 5, replace=False)
|
| 867 |
+
|
| 868 |
+
def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"])
|
| 869 |
+
def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3)
|
| 870 |
+
def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4)
|
| 871 |
+
def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True)
|
| 872 |
+
def_gen.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4]))
|
| 873 |
+
|
| 874 |
+
def_gen.dirichlet([0.5, 0.5])
|
| 875 |
+
def_gen.dirichlet(np.array([0.5, 0.5]))
|
| 876 |
+
def_gen.dirichlet(np.array([0.5, 0.5]), size=3)
|
| 877 |
+
|
| 878 |
+
def_gen.multinomial(20, [1 / 6.0] * 6)
|
| 879 |
+
def_gen.multinomial(20, np.array([0.5, 0.5]))
|
| 880 |
+
def_gen.multinomial(20, [1 / 6.0] * 6, size=2)
|
| 881 |
+
def_gen.multinomial([[10], [20]], [1 / 6.0] * 6, size=(2, 2))
|
| 882 |
+
def_gen.multinomial(np.array([[10], [20]]), np.array([0.5, 0.5]), size=(2, 2))
|
| 883 |
+
|
| 884 |
+
def_gen.multivariate_hypergeometric([3, 5, 7], 2)
|
| 885 |
+
def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2)
|
| 886 |
+
def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=4)
|
| 887 |
+
def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, size=(4, 7))
|
| 888 |
+
def_gen.multivariate_hypergeometric([3, 5, 7], 2, method="count")
|
| 889 |
+
def_gen.multivariate_hypergeometric(np.array([3, 5, 7]), 2, method="marginals")
|
| 890 |
+
|
| 891 |
+
def_gen.multivariate_normal([0.0], [[1.0]])
|
| 892 |
+
def_gen.multivariate_normal([0.0], np.array([[1.0]]))
|
| 893 |
+
def_gen.multivariate_normal(np.array([0.0]), [[1.0]])
|
| 894 |
+
def_gen.multivariate_normal([0.0], np.array([[1.0]]))
|
| 895 |
+
|
| 896 |
+
def_gen.permutation(10)
|
| 897 |
+
def_gen.permutation([1, 2, 3, 4])
|
| 898 |
+
def_gen.permutation(np.array([1, 2, 3, 4]))
|
| 899 |
+
def_gen.permutation(D_2D, axis=1)
|
| 900 |
+
def_gen.permuted(D_2D)
|
| 901 |
+
def_gen.permuted(D_2D_like)
|
| 902 |
+
def_gen.permuted(D_2D, axis=1)
|
| 903 |
+
def_gen.permuted(D_2D, out=D_2D)
|
| 904 |
+
def_gen.permuted(D_2D_like, out=D_2D)
|
| 905 |
+
def_gen.permuted(D_2D_like, out=D_2D)
|
| 906 |
+
def_gen.permuted(D_2D, axis=1, out=D_2D)
|
| 907 |
+
|
| 908 |
+
def_gen.shuffle(np.arange(10))
|
| 909 |
+
def_gen.shuffle([1, 2, 3, 4, 5])
|
| 910 |
+
def_gen.shuffle(D_2D, axis=1)
|
| 911 |
+
|
| 912 |
+
def_gen.__str__()
|
| 913 |
+
def_gen.__repr__()
|
| 914 |
+
def_gen_state: dict[str, Any]
|
| 915 |
+
def_gen_state = def_gen.__getstate__()
|
| 916 |
+
def_gen.__setstate__(def_gen_state)
|
| 917 |
+
|
| 918 |
+
# RandomState
|
| 919 |
+
random_st: np.random.RandomState = np.random.RandomState()
|
| 920 |
+
|
| 921 |
+
random_st.standard_normal()
|
| 922 |
+
random_st.standard_normal(size=None)
|
| 923 |
+
random_st.standard_normal(size=1)
|
| 924 |
+
|
| 925 |
+
random_st.random()
|
| 926 |
+
random_st.random(size=None)
|
| 927 |
+
random_st.random(size=1)
|
| 928 |
+
|
| 929 |
+
random_st.standard_cauchy()
|
| 930 |
+
random_st.standard_cauchy(size=None)
|
| 931 |
+
random_st.standard_cauchy(size=1)
|
| 932 |
+
|
| 933 |
+
random_st.standard_exponential()
|
| 934 |
+
random_st.standard_exponential(size=None)
|
| 935 |
+
random_st.standard_exponential(size=1)
|
| 936 |
+
|
| 937 |
+
random_st.zipf(1.5)
|
| 938 |
+
random_st.zipf(1.5, size=None)
|
| 939 |
+
random_st.zipf(1.5, size=1)
|
| 940 |
+
random_st.zipf(D_arr_1p5)
|
| 941 |
+
random_st.zipf(D_arr_1p5, size=1)
|
| 942 |
+
random_st.zipf(D_arr_like_1p5)
|
| 943 |
+
random_st.zipf(D_arr_like_1p5, size=1)
|
| 944 |
+
|
| 945 |
+
random_st.weibull(0.5)
|
| 946 |
+
random_st.weibull(0.5, size=None)
|
| 947 |
+
random_st.weibull(0.5, size=1)
|
| 948 |
+
random_st.weibull(D_arr_0p5)
|
| 949 |
+
random_st.weibull(D_arr_0p5, size=1)
|
| 950 |
+
random_st.weibull(D_arr_like_0p5)
|
| 951 |
+
random_st.weibull(D_arr_like_0p5, size=1)
|
| 952 |
+
|
| 953 |
+
random_st.standard_t(0.5)
|
| 954 |
+
random_st.standard_t(0.5, size=None)
|
| 955 |
+
random_st.standard_t(0.5, size=1)
|
| 956 |
+
random_st.standard_t(D_arr_0p5)
|
| 957 |
+
random_st.standard_t(D_arr_0p5, size=1)
|
| 958 |
+
random_st.standard_t(D_arr_like_0p5)
|
| 959 |
+
random_st.standard_t(D_arr_like_0p5, size=1)
|
| 960 |
+
|
| 961 |
+
random_st.poisson(0.5)
|
| 962 |
+
random_st.poisson(0.5, size=None)
|
| 963 |
+
random_st.poisson(0.5, size=1)
|
| 964 |
+
random_st.poisson(D_arr_0p5)
|
| 965 |
+
random_st.poisson(D_arr_0p5, size=1)
|
| 966 |
+
random_st.poisson(D_arr_like_0p5)
|
| 967 |
+
random_st.poisson(D_arr_like_0p5, size=1)
|
| 968 |
+
|
| 969 |
+
random_st.power(0.5)
|
| 970 |
+
random_st.power(0.5, size=None)
|
| 971 |
+
random_st.power(0.5, size=1)
|
| 972 |
+
random_st.power(D_arr_0p5)
|
| 973 |
+
random_st.power(D_arr_0p5, size=1)
|
| 974 |
+
random_st.power(D_arr_like_0p5)
|
| 975 |
+
random_st.power(D_arr_like_0p5, size=1)
|
| 976 |
+
|
| 977 |
+
random_st.pareto(0.5)
|
| 978 |
+
random_st.pareto(0.5, size=None)
|
| 979 |
+
random_st.pareto(0.5, size=1)
|
| 980 |
+
random_st.pareto(D_arr_0p5)
|
| 981 |
+
random_st.pareto(D_arr_0p5, size=1)
|
| 982 |
+
random_st.pareto(D_arr_like_0p5)
|
| 983 |
+
random_st.pareto(D_arr_like_0p5, size=1)
|
| 984 |
+
|
| 985 |
+
random_st.chisquare(0.5)
|
| 986 |
+
random_st.chisquare(0.5, size=None)
|
| 987 |
+
random_st.chisquare(0.5, size=1)
|
| 988 |
+
random_st.chisquare(D_arr_0p5)
|
| 989 |
+
random_st.chisquare(D_arr_0p5, size=1)
|
| 990 |
+
random_st.chisquare(D_arr_like_0p5)
|
| 991 |
+
random_st.chisquare(D_arr_like_0p5, size=1)
|
| 992 |
+
|
| 993 |
+
random_st.exponential(0.5)
|
| 994 |
+
random_st.exponential(0.5, size=None)
|
| 995 |
+
random_st.exponential(0.5, size=1)
|
| 996 |
+
random_st.exponential(D_arr_0p5)
|
| 997 |
+
random_st.exponential(D_arr_0p5, size=1)
|
| 998 |
+
random_st.exponential(D_arr_like_0p5)
|
| 999 |
+
random_st.exponential(D_arr_like_0p5, size=1)
|
| 1000 |
+
|
| 1001 |
+
random_st.geometric(0.5)
|
| 1002 |
+
random_st.geometric(0.5, size=None)
|
| 1003 |
+
random_st.geometric(0.5, size=1)
|
| 1004 |
+
random_st.geometric(D_arr_0p5)
|
| 1005 |
+
random_st.geometric(D_arr_0p5, size=1)
|
| 1006 |
+
random_st.geometric(D_arr_like_0p5)
|
| 1007 |
+
random_st.geometric(D_arr_like_0p5, size=1)
|
| 1008 |
+
|
| 1009 |
+
random_st.logseries(0.5)
|
| 1010 |
+
random_st.logseries(0.5, size=None)
|
| 1011 |
+
random_st.logseries(0.5, size=1)
|
| 1012 |
+
random_st.logseries(D_arr_0p5)
|
| 1013 |
+
random_st.logseries(D_arr_0p5, size=1)
|
| 1014 |
+
random_st.logseries(D_arr_like_0p5)
|
| 1015 |
+
random_st.logseries(D_arr_like_0p5, size=1)
|
| 1016 |
+
|
| 1017 |
+
random_st.rayleigh(0.5)
|
| 1018 |
+
random_st.rayleigh(0.5, size=None)
|
| 1019 |
+
random_st.rayleigh(0.5, size=1)
|
| 1020 |
+
random_st.rayleigh(D_arr_0p5)
|
| 1021 |
+
random_st.rayleigh(D_arr_0p5, size=1)
|
| 1022 |
+
random_st.rayleigh(D_arr_like_0p5)
|
| 1023 |
+
random_st.rayleigh(D_arr_like_0p5, size=1)
|
| 1024 |
+
|
| 1025 |
+
random_st.standard_gamma(0.5)
|
| 1026 |
+
random_st.standard_gamma(0.5, size=None)
|
| 1027 |
+
random_st.standard_gamma(0.5, size=1)
|
| 1028 |
+
random_st.standard_gamma(D_arr_0p5)
|
| 1029 |
+
random_st.standard_gamma(D_arr_0p5, size=1)
|
| 1030 |
+
random_st.standard_gamma(D_arr_like_0p5)
|
| 1031 |
+
random_st.standard_gamma(D_arr_like_0p5, size=1)
|
| 1032 |
+
random_st.standard_gamma(D_arr_like_0p5, size=1)
|
| 1033 |
+
|
| 1034 |
+
random_st.vonmises(0.5, 0.5)
|
| 1035 |
+
random_st.vonmises(0.5, 0.5, size=None)
|
| 1036 |
+
random_st.vonmises(0.5, 0.5, size=1)
|
| 1037 |
+
random_st.vonmises(D_arr_0p5, 0.5)
|
| 1038 |
+
random_st.vonmises(0.5, D_arr_0p5)
|
| 1039 |
+
random_st.vonmises(D_arr_0p5, 0.5, size=1)
|
| 1040 |
+
random_st.vonmises(0.5, D_arr_0p5, size=1)
|
| 1041 |
+
random_st.vonmises(D_arr_like_0p5, 0.5)
|
| 1042 |
+
random_st.vonmises(0.5, D_arr_like_0p5)
|
| 1043 |
+
random_st.vonmises(D_arr_0p5, D_arr_0p5)
|
| 1044 |
+
random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5)
|
| 1045 |
+
random_st.vonmises(D_arr_0p5, D_arr_0p5, size=1)
|
| 1046 |
+
random_st.vonmises(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1047 |
+
|
| 1048 |
+
random_st.wald(0.5, 0.5)
|
| 1049 |
+
random_st.wald(0.5, 0.5, size=None)
|
| 1050 |
+
random_st.wald(0.5, 0.5, size=1)
|
| 1051 |
+
random_st.wald(D_arr_0p5, 0.5)
|
| 1052 |
+
random_st.wald(0.5, D_arr_0p5)
|
| 1053 |
+
random_st.wald(D_arr_0p5, 0.5, size=1)
|
| 1054 |
+
random_st.wald(0.5, D_arr_0p5, size=1)
|
| 1055 |
+
random_st.wald(D_arr_like_0p5, 0.5)
|
| 1056 |
+
random_st.wald(0.5, D_arr_like_0p5)
|
| 1057 |
+
random_st.wald(D_arr_0p5, D_arr_0p5)
|
| 1058 |
+
random_st.wald(D_arr_like_0p5, D_arr_like_0p5)
|
| 1059 |
+
random_st.wald(D_arr_0p5, D_arr_0p5, size=1)
|
| 1060 |
+
random_st.wald(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1061 |
+
|
| 1062 |
+
random_st.uniform(0.5, 0.5)
|
| 1063 |
+
random_st.uniform(0.5, 0.5, size=None)
|
| 1064 |
+
random_st.uniform(0.5, 0.5, size=1)
|
| 1065 |
+
random_st.uniform(D_arr_0p5, 0.5)
|
| 1066 |
+
random_st.uniform(0.5, D_arr_0p5)
|
| 1067 |
+
random_st.uniform(D_arr_0p5, 0.5, size=1)
|
| 1068 |
+
random_st.uniform(0.5, D_arr_0p5, size=1)
|
| 1069 |
+
random_st.uniform(D_arr_like_0p5, 0.5)
|
| 1070 |
+
random_st.uniform(0.5, D_arr_like_0p5)
|
| 1071 |
+
random_st.uniform(D_arr_0p5, D_arr_0p5)
|
| 1072 |
+
random_st.uniform(D_arr_like_0p5, D_arr_like_0p5)
|
| 1073 |
+
random_st.uniform(D_arr_0p5, D_arr_0p5, size=1)
|
| 1074 |
+
random_st.uniform(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1075 |
+
|
| 1076 |
+
random_st.beta(0.5, 0.5)
|
| 1077 |
+
random_st.beta(0.5, 0.5, size=None)
|
| 1078 |
+
random_st.beta(0.5, 0.5, size=1)
|
| 1079 |
+
random_st.beta(D_arr_0p5, 0.5)
|
| 1080 |
+
random_st.beta(0.5, D_arr_0p5)
|
| 1081 |
+
random_st.beta(D_arr_0p5, 0.5, size=1)
|
| 1082 |
+
random_st.beta(0.5, D_arr_0p5, size=1)
|
| 1083 |
+
random_st.beta(D_arr_like_0p5, 0.5)
|
| 1084 |
+
random_st.beta(0.5, D_arr_like_0p5)
|
| 1085 |
+
random_st.beta(D_arr_0p5, D_arr_0p5)
|
| 1086 |
+
random_st.beta(D_arr_like_0p5, D_arr_like_0p5)
|
| 1087 |
+
random_st.beta(D_arr_0p5, D_arr_0p5, size=1)
|
| 1088 |
+
random_st.beta(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1089 |
+
|
| 1090 |
+
random_st.f(0.5, 0.5)
|
| 1091 |
+
random_st.f(0.5, 0.5, size=None)
|
| 1092 |
+
random_st.f(0.5, 0.5, size=1)
|
| 1093 |
+
random_st.f(D_arr_0p5, 0.5)
|
| 1094 |
+
random_st.f(0.5, D_arr_0p5)
|
| 1095 |
+
random_st.f(D_arr_0p5, 0.5, size=1)
|
| 1096 |
+
random_st.f(0.5, D_arr_0p5, size=1)
|
| 1097 |
+
random_st.f(D_arr_like_0p5, 0.5)
|
| 1098 |
+
random_st.f(0.5, D_arr_like_0p5)
|
| 1099 |
+
random_st.f(D_arr_0p5, D_arr_0p5)
|
| 1100 |
+
random_st.f(D_arr_like_0p5, D_arr_like_0p5)
|
| 1101 |
+
random_st.f(D_arr_0p5, D_arr_0p5, size=1)
|
| 1102 |
+
random_st.f(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1103 |
+
|
| 1104 |
+
random_st.gamma(0.5, 0.5)
|
| 1105 |
+
random_st.gamma(0.5, 0.5, size=None)
|
| 1106 |
+
random_st.gamma(0.5, 0.5, size=1)
|
| 1107 |
+
random_st.gamma(D_arr_0p5, 0.5)
|
| 1108 |
+
random_st.gamma(0.5, D_arr_0p5)
|
| 1109 |
+
random_st.gamma(D_arr_0p5, 0.5, size=1)
|
| 1110 |
+
random_st.gamma(0.5, D_arr_0p5, size=1)
|
| 1111 |
+
random_st.gamma(D_arr_like_0p5, 0.5)
|
| 1112 |
+
random_st.gamma(0.5, D_arr_like_0p5)
|
| 1113 |
+
random_st.gamma(D_arr_0p5, D_arr_0p5)
|
| 1114 |
+
random_st.gamma(D_arr_like_0p5, D_arr_like_0p5)
|
| 1115 |
+
random_st.gamma(D_arr_0p5, D_arr_0p5, size=1)
|
| 1116 |
+
random_st.gamma(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1117 |
+
|
| 1118 |
+
random_st.gumbel(0.5, 0.5)
|
| 1119 |
+
random_st.gumbel(0.5, 0.5, size=None)
|
| 1120 |
+
random_st.gumbel(0.5, 0.5, size=1)
|
| 1121 |
+
random_st.gumbel(D_arr_0p5, 0.5)
|
| 1122 |
+
random_st.gumbel(0.5, D_arr_0p5)
|
| 1123 |
+
random_st.gumbel(D_arr_0p5, 0.5, size=1)
|
| 1124 |
+
random_st.gumbel(0.5, D_arr_0p5, size=1)
|
| 1125 |
+
random_st.gumbel(D_arr_like_0p5, 0.5)
|
| 1126 |
+
random_st.gumbel(0.5, D_arr_like_0p5)
|
| 1127 |
+
random_st.gumbel(D_arr_0p5, D_arr_0p5)
|
| 1128 |
+
random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5)
|
| 1129 |
+
random_st.gumbel(D_arr_0p5, D_arr_0p5, size=1)
|
| 1130 |
+
random_st.gumbel(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1131 |
+
|
| 1132 |
+
random_st.laplace(0.5, 0.5)
|
| 1133 |
+
random_st.laplace(0.5, 0.5, size=None)
|
| 1134 |
+
random_st.laplace(0.5, 0.5, size=1)
|
| 1135 |
+
random_st.laplace(D_arr_0p5, 0.5)
|
| 1136 |
+
random_st.laplace(0.5, D_arr_0p5)
|
| 1137 |
+
random_st.laplace(D_arr_0p5, 0.5, size=1)
|
| 1138 |
+
random_st.laplace(0.5, D_arr_0p5, size=1)
|
| 1139 |
+
random_st.laplace(D_arr_like_0p5, 0.5)
|
| 1140 |
+
random_st.laplace(0.5, D_arr_like_0p5)
|
| 1141 |
+
random_st.laplace(D_arr_0p5, D_arr_0p5)
|
| 1142 |
+
random_st.laplace(D_arr_like_0p5, D_arr_like_0p5)
|
| 1143 |
+
random_st.laplace(D_arr_0p5, D_arr_0p5, size=1)
|
| 1144 |
+
random_st.laplace(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1145 |
+
|
| 1146 |
+
random_st.logistic(0.5, 0.5)
|
| 1147 |
+
random_st.logistic(0.5, 0.5, size=None)
|
| 1148 |
+
random_st.logistic(0.5, 0.5, size=1)
|
| 1149 |
+
random_st.logistic(D_arr_0p5, 0.5)
|
| 1150 |
+
random_st.logistic(0.5, D_arr_0p5)
|
| 1151 |
+
random_st.logistic(D_arr_0p5, 0.5, size=1)
|
| 1152 |
+
random_st.logistic(0.5, D_arr_0p5, size=1)
|
| 1153 |
+
random_st.logistic(D_arr_like_0p5, 0.5)
|
| 1154 |
+
random_st.logistic(0.5, D_arr_like_0p5)
|
| 1155 |
+
random_st.logistic(D_arr_0p5, D_arr_0p5)
|
| 1156 |
+
random_st.logistic(D_arr_like_0p5, D_arr_like_0p5)
|
| 1157 |
+
random_st.logistic(D_arr_0p5, D_arr_0p5, size=1)
|
| 1158 |
+
random_st.logistic(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1159 |
+
|
| 1160 |
+
random_st.lognormal(0.5, 0.5)
|
| 1161 |
+
random_st.lognormal(0.5, 0.5, size=None)
|
| 1162 |
+
random_st.lognormal(0.5, 0.5, size=1)
|
| 1163 |
+
random_st.lognormal(D_arr_0p5, 0.5)
|
| 1164 |
+
random_st.lognormal(0.5, D_arr_0p5)
|
| 1165 |
+
random_st.lognormal(D_arr_0p5, 0.5, size=1)
|
| 1166 |
+
random_st.lognormal(0.5, D_arr_0p5, size=1)
|
| 1167 |
+
random_st.lognormal(D_arr_like_0p5, 0.5)
|
| 1168 |
+
random_st.lognormal(0.5, D_arr_like_0p5)
|
| 1169 |
+
random_st.lognormal(D_arr_0p5, D_arr_0p5)
|
| 1170 |
+
random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5)
|
| 1171 |
+
random_st.lognormal(D_arr_0p5, D_arr_0p5, size=1)
|
| 1172 |
+
random_st.lognormal(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1173 |
+
|
| 1174 |
+
random_st.noncentral_chisquare(0.5, 0.5)
|
| 1175 |
+
random_st.noncentral_chisquare(0.5, 0.5, size=None)
|
| 1176 |
+
random_st.noncentral_chisquare(0.5, 0.5, size=1)
|
| 1177 |
+
random_st.noncentral_chisquare(D_arr_0p5, 0.5)
|
| 1178 |
+
random_st.noncentral_chisquare(0.5, D_arr_0p5)
|
| 1179 |
+
random_st.noncentral_chisquare(D_arr_0p5, 0.5, size=1)
|
| 1180 |
+
random_st.noncentral_chisquare(0.5, D_arr_0p5, size=1)
|
| 1181 |
+
random_st.noncentral_chisquare(D_arr_like_0p5, 0.5)
|
| 1182 |
+
random_st.noncentral_chisquare(0.5, D_arr_like_0p5)
|
| 1183 |
+
random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5)
|
| 1184 |
+
random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5)
|
| 1185 |
+
random_st.noncentral_chisquare(D_arr_0p5, D_arr_0p5, size=1)
|
| 1186 |
+
random_st.noncentral_chisquare(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1187 |
+
|
| 1188 |
+
random_st.normal(0.5, 0.5)
|
| 1189 |
+
random_st.normal(0.5, 0.5, size=None)
|
| 1190 |
+
random_st.normal(0.5, 0.5, size=1)
|
| 1191 |
+
random_st.normal(D_arr_0p5, 0.5)
|
| 1192 |
+
random_st.normal(0.5, D_arr_0p5)
|
| 1193 |
+
random_st.normal(D_arr_0p5, 0.5, size=1)
|
| 1194 |
+
random_st.normal(0.5, D_arr_0p5, size=1)
|
| 1195 |
+
random_st.normal(D_arr_like_0p5, 0.5)
|
| 1196 |
+
random_st.normal(0.5, D_arr_like_0p5)
|
| 1197 |
+
random_st.normal(D_arr_0p5, D_arr_0p5)
|
| 1198 |
+
random_st.normal(D_arr_like_0p5, D_arr_like_0p5)
|
| 1199 |
+
random_st.normal(D_arr_0p5, D_arr_0p5, size=1)
|
| 1200 |
+
random_st.normal(D_arr_like_0p5, D_arr_like_0p5, size=1)
|
| 1201 |
+
|
| 1202 |
+
random_st.triangular(0.1, 0.5, 0.9)
|
| 1203 |
+
random_st.triangular(0.1, 0.5, 0.9, size=None)
|
| 1204 |
+
random_st.triangular(0.1, 0.5, 0.9, size=1)
|
| 1205 |
+
random_st.triangular(D_arr_0p1, 0.5, 0.9)
|
| 1206 |
+
random_st.triangular(0.1, D_arr_0p5, 0.9)
|
| 1207 |
+
random_st.triangular(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)
|
| 1208 |
+
random_st.triangular(0.1, D_arr_0p5, 0.9, size=1)
|
| 1209 |
+
random_st.triangular(D_arr_like_0p1, 0.5, D_arr_0p9)
|
| 1210 |
+
random_st.triangular(0.5, D_arr_like_0p5, 0.9)
|
| 1211 |
+
random_st.triangular(D_arr_0p1, D_arr_0p5, 0.9)
|
| 1212 |
+
random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, 0.9)
|
| 1213 |
+
random_st.triangular(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)
|
| 1214 |
+
random_st.triangular(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)
|
| 1215 |
+
|
| 1216 |
+
random_st.noncentral_f(0.1, 0.5, 0.9)
|
| 1217 |
+
random_st.noncentral_f(0.1, 0.5, 0.9, size=None)
|
| 1218 |
+
random_st.noncentral_f(0.1, 0.5, 0.9, size=1)
|
| 1219 |
+
random_st.noncentral_f(D_arr_0p1, 0.5, 0.9)
|
| 1220 |
+
random_st.noncentral_f(0.1, D_arr_0p5, 0.9)
|
| 1221 |
+
random_st.noncentral_f(D_arr_0p1, 0.5, D_arr_like_0p9, size=1)
|
| 1222 |
+
random_st.noncentral_f(0.1, D_arr_0p5, 0.9, size=1)
|
| 1223 |
+
random_st.noncentral_f(D_arr_like_0p1, 0.5, D_arr_0p9)
|
| 1224 |
+
random_st.noncentral_f(0.5, D_arr_like_0p5, 0.9)
|
| 1225 |
+
random_st.noncentral_f(D_arr_0p1, D_arr_0p5, 0.9)
|
| 1226 |
+
random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, 0.9)
|
| 1227 |
+
random_st.noncentral_f(D_arr_0p1, D_arr_0p5, D_arr_0p9, size=1)
|
| 1228 |
+
random_st.noncentral_f(D_arr_like_0p1, D_arr_like_0p5, D_arr_like_0p9, size=1)
|
| 1229 |
+
|
| 1230 |
+
random_st.binomial(10, 0.5)
|
| 1231 |
+
random_st.binomial(10, 0.5, size=None)
|
| 1232 |
+
random_st.binomial(10, 0.5, size=1)
|
| 1233 |
+
random_st.binomial(I_arr_10, 0.5)
|
| 1234 |
+
random_st.binomial(10, D_arr_0p5)
|
| 1235 |
+
random_st.binomial(I_arr_10, 0.5, size=1)
|
| 1236 |
+
random_st.binomial(10, D_arr_0p5, size=1)
|
| 1237 |
+
random_st.binomial(I_arr_like_10, 0.5)
|
| 1238 |
+
random_st.binomial(10, D_arr_like_0p5)
|
| 1239 |
+
random_st.binomial(I_arr_10, D_arr_0p5)
|
| 1240 |
+
random_st.binomial(I_arr_like_10, D_arr_like_0p5)
|
| 1241 |
+
random_st.binomial(I_arr_10, D_arr_0p5, size=1)
|
| 1242 |
+
random_st.binomial(I_arr_like_10, D_arr_like_0p5, size=1)
|
| 1243 |
+
|
| 1244 |
+
random_st.negative_binomial(10, 0.5)
|
| 1245 |
+
random_st.negative_binomial(10, 0.5, size=None)
|
| 1246 |
+
random_st.negative_binomial(10, 0.5, size=1)
|
| 1247 |
+
random_st.negative_binomial(I_arr_10, 0.5)
|
| 1248 |
+
random_st.negative_binomial(10, D_arr_0p5)
|
| 1249 |
+
random_st.negative_binomial(I_arr_10, 0.5, size=1)
|
| 1250 |
+
random_st.negative_binomial(10, D_arr_0p5, size=1)
|
| 1251 |
+
random_st.negative_binomial(I_arr_like_10, 0.5)
|
| 1252 |
+
random_st.negative_binomial(10, D_arr_like_0p5)
|
| 1253 |
+
random_st.negative_binomial(I_arr_10, D_arr_0p5)
|
| 1254 |
+
random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5)
|
| 1255 |
+
random_st.negative_binomial(I_arr_10, D_arr_0p5, size=1)
|
| 1256 |
+
random_st.negative_binomial(I_arr_like_10, D_arr_like_0p5, size=1)
|
| 1257 |
+
|
| 1258 |
+
random_st.hypergeometric(20, 20, 10)
|
| 1259 |
+
random_st.hypergeometric(20, 20, 10, size=None)
|
| 1260 |
+
random_st.hypergeometric(20, 20, 10, size=1)
|
| 1261 |
+
random_st.hypergeometric(I_arr_20, 20, 10)
|
| 1262 |
+
random_st.hypergeometric(20, I_arr_20, 10)
|
| 1263 |
+
random_st.hypergeometric(I_arr_20, 20, I_arr_like_10, size=1)
|
| 1264 |
+
random_st.hypergeometric(20, I_arr_20, 10, size=1)
|
| 1265 |
+
random_st.hypergeometric(I_arr_like_20, 20, I_arr_10)
|
| 1266 |
+
random_st.hypergeometric(20, I_arr_like_20, 10)
|
| 1267 |
+
random_st.hypergeometric(I_arr_20, I_arr_20, 10)
|
| 1268 |
+
random_st.hypergeometric(I_arr_like_20, I_arr_like_20, 10)
|
| 1269 |
+
random_st.hypergeometric(I_arr_20, I_arr_20, I_arr_10, size=1)
|
| 1270 |
+
random_st.hypergeometric(I_arr_like_20, I_arr_like_20, I_arr_like_10, size=1)
|
| 1271 |
+
|
| 1272 |
+
random_st.randint(0, 100)
|
| 1273 |
+
random_st.randint(100)
|
| 1274 |
+
random_st.randint([100])
|
| 1275 |
+
random_st.randint(0, [100])
|
| 1276 |
+
|
| 1277 |
+
random_st.randint(2, dtype=bool)
|
| 1278 |
+
random_st.randint(0, 2, dtype=bool)
|
| 1279 |
+
random_st.randint(I_bool_high_open, dtype=bool)
|
| 1280 |
+
random_st.randint(I_bool_low, I_bool_high_open, dtype=bool)
|
| 1281 |
+
random_st.randint(0, I_bool_high_open, dtype=bool)
|
| 1282 |
+
|
| 1283 |
+
random_st.randint(2, dtype=np.bool_)
|
| 1284 |
+
random_st.randint(0, 2, dtype=np.bool_)
|
| 1285 |
+
random_st.randint(I_bool_high_open, dtype=np.bool_)
|
| 1286 |
+
random_st.randint(I_bool_low, I_bool_high_open, dtype=np.bool_)
|
| 1287 |
+
random_st.randint(0, I_bool_high_open, dtype=np.bool_)
|
| 1288 |
+
|
| 1289 |
+
random_st.randint(256, dtype="u1")
|
| 1290 |
+
random_st.randint(0, 256, dtype="u1")
|
| 1291 |
+
random_st.randint(I_u1_high_open, dtype="u1")
|
| 1292 |
+
random_st.randint(I_u1_low, I_u1_high_open, dtype="u1")
|
| 1293 |
+
random_st.randint(0, I_u1_high_open, dtype="u1")
|
| 1294 |
+
|
| 1295 |
+
random_st.randint(256, dtype="uint8")
|
| 1296 |
+
random_st.randint(0, 256, dtype="uint8")
|
| 1297 |
+
random_st.randint(I_u1_high_open, dtype="uint8")
|
| 1298 |
+
random_st.randint(I_u1_low, I_u1_high_open, dtype="uint8")
|
| 1299 |
+
random_st.randint(0, I_u1_high_open, dtype="uint8")
|
| 1300 |
+
|
| 1301 |
+
random_st.randint(256, dtype=np.uint8)
|
| 1302 |
+
random_st.randint(0, 256, dtype=np.uint8)
|
| 1303 |
+
random_st.randint(I_u1_high_open, dtype=np.uint8)
|
| 1304 |
+
random_st.randint(I_u1_low, I_u1_high_open, dtype=np.uint8)
|
| 1305 |
+
random_st.randint(0, I_u1_high_open, dtype=np.uint8)
|
| 1306 |
+
|
| 1307 |
+
random_st.randint(65536, dtype="u2")
|
| 1308 |
+
random_st.randint(0, 65536, dtype="u2")
|
| 1309 |
+
random_st.randint(I_u2_high_open, dtype="u2")
|
| 1310 |
+
random_st.randint(I_u2_low, I_u2_high_open, dtype="u2")
|
| 1311 |
+
random_st.randint(0, I_u2_high_open, dtype="u2")
|
| 1312 |
+
|
| 1313 |
+
random_st.randint(65536, dtype="uint16")
|
| 1314 |
+
random_st.randint(0, 65536, dtype="uint16")
|
| 1315 |
+
random_st.randint(I_u2_high_open, dtype="uint16")
|
| 1316 |
+
random_st.randint(I_u2_low, I_u2_high_open, dtype="uint16")
|
| 1317 |
+
random_st.randint(0, I_u2_high_open, dtype="uint16")
|
| 1318 |
+
|
| 1319 |
+
random_st.randint(65536, dtype=np.uint16)
|
| 1320 |
+
random_st.randint(0, 65536, dtype=np.uint16)
|
| 1321 |
+
random_st.randint(I_u2_high_open, dtype=np.uint16)
|
| 1322 |
+
random_st.randint(I_u2_low, I_u2_high_open, dtype=np.uint16)
|
| 1323 |
+
random_st.randint(0, I_u2_high_open, dtype=np.uint16)
|
| 1324 |
+
|
| 1325 |
+
random_st.randint(4294967296, dtype="u4")
|
| 1326 |
+
random_st.randint(0, 4294967296, dtype="u4")
|
| 1327 |
+
random_st.randint(I_u4_high_open, dtype="u4")
|
| 1328 |
+
random_st.randint(I_u4_low, I_u4_high_open, dtype="u4")
|
| 1329 |
+
random_st.randint(0, I_u4_high_open, dtype="u4")
|
| 1330 |
+
|
| 1331 |
+
random_st.randint(4294967296, dtype="uint32")
|
| 1332 |
+
random_st.randint(0, 4294967296, dtype="uint32")
|
| 1333 |
+
random_st.randint(I_u4_high_open, dtype="uint32")
|
| 1334 |
+
random_st.randint(I_u4_low, I_u4_high_open, dtype="uint32")
|
| 1335 |
+
random_st.randint(0, I_u4_high_open, dtype="uint32")
|
| 1336 |
+
|
| 1337 |
+
random_st.randint(4294967296, dtype=np.uint32)
|
| 1338 |
+
random_st.randint(0, 4294967296, dtype=np.uint32)
|
| 1339 |
+
random_st.randint(I_u4_high_open, dtype=np.uint32)
|
| 1340 |
+
random_st.randint(I_u4_low, I_u4_high_open, dtype=np.uint32)
|
| 1341 |
+
random_st.randint(0, I_u4_high_open, dtype=np.uint32)
|
| 1342 |
+
|
| 1343 |
+
|
| 1344 |
+
random_st.randint(18446744073709551616, dtype="u8")
|
| 1345 |
+
random_st.randint(0, 18446744073709551616, dtype="u8")
|
| 1346 |
+
random_st.randint(I_u8_high_open, dtype="u8")
|
| 1347 |
+
random_st.randint(I_u8_low, I_u8_high_open, dtype="u8")
|
| 1348 |
+
random_st.randint(0, I_u8_high_open, dtype="u8")
|
| 1349 |
+
|
| 1350 |
+
random_st.randint(18446744073709551616, dtype="uint64")
|
| 1351 |
+
random_st.randint(0, 18446744073709551616, dtype="uint64")
|
| 1352 |
+
random_st.randint(I_u8_high_open, dtype="uint64")
|
| 1353 |
+
random_st.randint(I_u8_low, I_u8_high_open, dtype="uint64")
|
| 1354 |
+
random_st.randint(0, I_u8_high_open, dtype="uint64")
|
| 1355 |
+
|
| 1356 |
+
random_st.randint(18446744073709551616, dtype=np.uint64)
|
| 1357 |
+
random_st.randint(0, 18446744073709551616, dtype=np.uint64)
|
| 1358 |
+
random_st.randint(I_u8_high_open, dtype=np.uint64)
|
| 1359 |
+
random_st.randint(I_u8_low, I_u8_high_open, dtype=np.uint64)
|
| 1360 |
+
random_st.randint(0, I_u8_high_open, dtype=np.uint64)
|
| 1361 |
+
|
| 1362 |
+
random_st.randint(128, dtype="i1")
|
| 1363 |
+
random_st.randint(-128, 128, dtype="i1")
|
| 1364 |
+
random_st.randint(I_i1_high_open, dtype="i1")
|
| 1365 |
+
random_st.randint(I_i1_low, I_i1_high_open, dtype="i1")
|
| 1366 |
+
random_st.randint(-128, I_i1_high_open, dtype="i1")
|
| 1367 |
+
|
| 1368 |
+
random_st.randint(128, dtype="int8")
|
| 1369 |
+
random_st.randint(-128, 128, dtype="int8")
|
| 1370 |
+
random_st.randint(I_i1_high_open, dtype="int8")
|
| 1371 |
+
random_st.randint(I_i1_low, I_i1_high_open, dtype="int8")
|
| 1372 |
+
random_st.randint(-128, I_i1_high_open, dtype="int8")
|
| 1373 |
+
|
| 1374 |
+
random_st.randint(128, dtype=np.int8)
|
| 1375 |
+
random_st.randint(-128, 128, dtype=np.int8)
|
| 1376 |
+
random_st.randint(I_i1_high_open, dtype=np.int8)
|
| 1377 |
+
random_st.randint(I_i1_low, I_i1_high_open, dtype=np.int8)
|
| 1378 |
+
random_st.randint(-128, I_i1_high_open, dtype=np.int8)
|
| 1379 |
+
|
| 1380 |
+
random_st.randint(32768, dtype="i2")
|
| 1381 |
+
random_st.randint(-32768, 32768, dtype="i2")
|
| 1382 |
+
random_st.randint(I_i2_high_open, dtype="i2")
|
| 1383 |
+
random_st.randint(I_i2_low, I_i2_high_open, dtype="i2")
|
| 1384 |
+
random_st.randint(-32768, I_i2_high_open, dtype="i2")
|
| 1385 |
+
random_st.randint(32768, dtype="int16")
|
| 1386 |
+
random_st.randint(-32768, 32768, dtype="int16")
|
| 1387 |
+
random_st.randint(I_i2_high_open, dtype="int16")
|
| 1388 |
+
random_st.randint(I_i2_low, I_i2_high_open, dtype="int16")
|
| 1389 |
+
random_st.randint(-32768, I_i2_high_open, dtype="int16")
|
| 1390 |
+
random_st.randint(32768, dtype=np.int16)
|
| 1391 |
+
random_st.randint(-32768, 32768, dtype=np.int16)
|
| 1392 |
+
random_st.randint(I_i2_high_open, dtype=np.int16)
|
| 1393 |
+
random_st.randint(I_i2_low, I_i2_high_open, dtype=np.int16)
|
| 1394 |
+
random_st.randint(-32768, I_i2_high_open, dtype=np.int16)
|
| 1395 |
+
|
| 1396 |
+
random_st.randint(2147483648, dtype="i4")
|
| 1397 |
+
random_st.randint(-2147483648, 2147483648, dtype="i4")
|
| 1398 |
+
random_st.randint(I_i4_high_open, dtype="i4")
|
| 1399 |
+
random_st.randint(I_i4_low, I_i4_high_open, dtype="i4")
|
| 1400 |
+
random_st.randint(-2147483648, I_i4_high_open, dtype="i4")
|
| 1401 |
+
|
| 1402 |
+
random_st.randint(2147483648, dtype="int32")
|
| 1403 |
+
random_st.randint(-2147483648, 2147483648, dtype="int32")
|
| 1404 |
+
random_st.randint(I_i4_high_open, dtype="int32")
|
| 1405 |
+
random_st.randint(I_i4_low, I_i4_high_open, dtype="int32")
|
| 1406 |
+
random_st.randint(-2147483648, I_i4_high_open, dtype="int32")
|
| 1407 |
+
|
| 1408 |
+
random_st.randint(2147483648, dtype=np.int32)
|
| 1409 |
+
random_st.randint(-2147483648, 2147483648, dtype=np.int32)
|
| 1410 |
+
random_st.randint(I_i4_high_open, dtype=np.int32)
|
| 1411 |
+
random_st.randint(I_i4_low, I_i4_high_open, dtype=np.int32)
|
| 1412 |
+
random_st.randint(-2147483648, I_i4_high_open, dtype=np.int32)
|
| 1413 |
+
|
| 1414 |
+
random_st.randint(9223372036854775808, dtype="i8")
|
| 1415 |
+
random_st.randint(-9223372036854775808, 9223372036854775808, dtype="i8")
|
| 1416 |
+
random_st.randint(I_i8_high_open, dtype="i8")
|
| 1417 |
+
random_st.randint(I_i8_low, I_i8_high_open, dtype="i8")
|
| 1418 |
+
random_st.randint(-9223372036854775808, I_i8_high_open, dtype="i8")
|
| 1419 |
+
|
| 1420 |
+
random_st.randint(9223372036854775808, dtype="int64")
|
| 1421 |
+
random_st.randint(-9223372036854775808, 9223372036854775808, dtype="int64")
|
| 1422 |
+
random_st.randint(I_i8_high_open, dtype="int64")
|
| 1423 |
+
random_st.randint(I_i8_low, I_i8_high_open, dtype="int64")
|
| 1424 |
+
random_st.randint(-9223372036854775808, I_i8_high_open, dtype="int64")
|
| 1425 |
+
|
| 1426 |
+
random_st.randint(9223372036854775808, dtype=np.int64)
|
| 1427 |
+
random_st.randint(-9223372036854775808, 9223372036854775808, dtype=np.int64)
|
| 1428 |
+
random_st.randint(I_i8_high_open, dtype=np.int64)
|
| 1429 |
+
random_st.randint(I_i8_low, I_i8_high_open, dtype=np.int64)
|
| 1430 |
+
random_st.randint(-9223372036854775808, I_i8_high_open, dtype=np.int64)
|
| 1431 |
+
|
| 1432 |
+
bg: np.random.BitGenerator = random_st._bit_generator
|
| 1433 |
+
|
| 1434 |
+
random_st.bytes(2)
|
| 1435 |
+
|
| 1436 |
+
random_st.choice(5)
|
| 1437 |
+
random_st.choice(5, 3)
|
| 1438 |
+
random_st.choice(5, 3, replace=True)
|
| 1439 |
+
random_st.choice(5, 3, p=[1 / 5] * 5)
|
| 1440 |
+
random_st.choice(5, 3, p=[1 / 5] * 5, replace=False)
|
| 1441 |
+
|
| 1442 |
+
random_st.choice(["pooh", "rabbit", "piglet", "Christopher"])
|
| 1443 |
+
random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3)
|
| 1444 |
+
random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, p=[1 / 4] * 4)
|
| 1445 |
+
random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=True)
|
| 1446 |
+
random_st.choice(["pooh", "rabbit", "piglet", "Christopher"], 3, replace=False, p=np.array([1 / 8, 1 / 8, 1 / 2, 1 / 4]))
|
| 1447 |
+
|
| 1448 |
+
random_st.dirichlet([0.5, 0.5])
|
| 1449 |
+
random_st.dirichlet(np.array([0.5, 0.5]))
|
| 1450 |
+
random_st.dirichlet(np.array([0.5, 0.5]), size=3)
|
| 1451 |
+
|
| 1452 |
+
random_st.multinomial(20, [1 / 6.0] * 6)
|
| 1453 |
+
random_st.multinomial(20, np.array([0.5, 0.5]))
|
| 1454 |
+
random_st.multinomial(20, [1 / 6.0] * 6, size=2)
|
| 1455 |
+
|
| 1456 |
+
random_st.multivariate_normal([0.0], [[1.0]])
|
| 1457 |
+
random_st.multivariate_normal([0.0], np.array([[1.0]]))
|
| 1458 |
+
random_st.multivariate_normal(np.array([0.0]), [[1.0]])
|
| 1459 |
+
random_st.multivariate_normal([0.0], np.array([[1.0]]))
|
| 1460 |
+
|
| 1461 |
+
random_st.permutation(10)
|
| 1462 |
+
random_st.permutation([1, 2, 3, 4])
|
| 1463 |
+
random_st.permutation(np.array([1, 2, 3, 4]))
|
| 1464 |
+
random_st.permutation(D_2D)
|
| 1465 |
+
|
| 1466 |
+
random_st.shuffle(np.arange(10))
|
| 1467 |
+
random_st.shuffle([1, 2, 3, 4, 5])
|
| 1468 |
+
random_st.shuffle(D_2D)
|
| 1469 |
+
|
| 1470 |
+
np.random.RandomState(SEED_PCG64)
|
| 1471 |
+
np.random.RandomState(0)
|
| 1472 |
+
np.random.RandomState([0, 1, 2])
|
| 1473 |
+
random_st.__str__()
|
| 1474 |
+
random_st.__repr__()
|
| 1475 |
+
random_st_state = random_st.__getstate__()
|
| 1476 |
+
random_st.__setstate__(random_st_state)
|
| 1477 |
+
random_st.seed()
|
| 1478 |
+
random_st.seed(1)
|
| 1479 |
+
random_st.seed([0, 1])
|
| 1480 |
+
random_st_get_state = random_st.get_state()
|
| 1481 |
+
random_st_get_state_legacy = random_st.get_state(legacy=True)
|
| 1482 |
+
random_st.set_state(random_st_get_state)
|
| 1483 |
+
|
| 1484 |
+
random_st.rand()
|
| 1485 |
+
random_st.rand(1)
|
| 1486 |
+
random_st.rand(1, 2)
|
| 1487 |
+
random_st.randn()
|
| 1488 |
+
random_st.randn(1)
|
| 1489 |
+
random_st.randn(1, 2)
|
| 1490 |
+
random_st.random_sample()
|
| 1491 |
+
random_st.random_sample(1)
|
| 1492 |
+
random_st.random_sample(size=(1, 2))
|
| 1493 |
+
|
| 1494 |
+
random_st.tomaxint()
|
| 1495 |
+
random_st.tomaxint(1)
|
| 1496 |
+
random_st.tomaxint((1,))
|
| 1497 |
+
|
| 1498 |
+
np.random.set_bit_generator(SEED_PCG64)
|
| 1499 |
+
np.random.get_bit_generator()
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/scalars.py
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
| 1 |
+
import sys
|
| 2 |
+
import datetime as dt
|
| 3 |
+
|
| 4 |
+
import pytest
|
| 5 |
+
import numpy as np
|
| 6 |
+
|
| 7 |
+
b = np.bool_()
|
| 8 |
+
u8 = np.uint64()
|
| 9 |
+
i8 = np.int64()
|
| 10 |
+
f8 = np.float64()
|
| 11 |
+
c16 = np.complex128()
|
| 12 |
+
U = np.str_()
|
| 13 |
+
S = np.bytes_()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
# Construction
|
| 17 |
+
class D:
|
| 18 |
+
def __index__(self) -> int:
|
| 19 |
+
return 0
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
class C:
|
| 23 |
+
def __complex__(self) -> complex:
|
| 24 |
+
return 3j
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class B:
|
| 28 |
+
def __int__(self) -> int:
|
| 29 |
+
return 4
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
class A:
|
| 33 |
+
def __float__(self) -> float:
|
| 34 |
+
return 4.0
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
np.complex64(3j)
|
| 38 |
+
np.complex64(A())
|
| 39 |
+
np.complex64(C())
|
| 40 |
+
np.complex128(3j)
|
| 41 |
+
np.complex128(C())
|
| 42 |
+
np.complex128(None)
|
| 43 |
+
np.complex64("1.2")
|
| 44 |
+
np.complex128(b"2j")
|
| 45 |
+
|
| 46 |
+
np.int8(4)
|
| 47 |
+
np.int16(3.4)
|
| 48 |
+
np.int32(4)
|
| 49 |
+
np.int64(-1)
|
| 50 |
+
np.uint8(B())
|
| 51 |
+
np.uint32()
|
| 52 |
+
np.int32("1")
|
| 53 |
+
np.int64(b"2")
|
| 54 |
+
|
| 55 |
+
np.float16(A())
|
| 56 |
+
np.float32(16)
|
| 57 |
+
np.float64(3.0)
|
| 58 |
+
np.float64(None)
|
| 59 |
+
np.float32("1")
|
| 60 |
+
np.float16(b"2.5")
|
| 61 |
+
|
| 62 |
+
np.uint64(D())
|
| 63 |
+
np.float32(D())
|
| 64 |
+
np.complex64(D())
|
| 65 |
+
|
| 66 |
+
np.bytes_(b"hello")
|
| 67 |
+
np.bytes_("hello", 'utf-8')
|
| 68 |
+
np.bytes_("hello", encoding='utf-8')
|
| 69 |
+
np.str_("hello")
|
| 70 |
+
np.str_(b"hello", 'utf-8')
|
| 71 |
+
np.str_(b"hello", encoding='utf-8')
|
| 72 |
+
|
| 73 |
+
# Array-ish semantics
|
| 74 |
+
np.int8().real
|
| 75 |
+
np.int16().imag
|
| 76 |
+
np.int32().data
|
| 77 |
+
np.int64().flags
|
| 78 |
+
|
| 79 |
+
np.uint8().itemsize * 2
|
| 80 |
+
np.uint16().ndim + 1
|
| 81 |
+
np.uint32().strides
|
| 82 |
+
np.uint64().shape
|
| 83 |
+
|
| 84 |
+
# Time structures
|
| 85 |
+
np.datetime64()
|
| 86 |
+
np.datetime64(0, "D")
|
| 87 |
+
np.datetime64(0, b"D")
|
| 88 |
+
np.datetime64(0, ('ms', 3))
|
| 89 |
+
np.datetime64("2019")
|
| 90 |
+
np.datetime64(b"2019")
|
| 91 |
+
np.datetime64("2019", "D")
|
| 92 |
+
np.datetime64(np.datetime64())
|
| 93 |
+
np.datetime64(dt.datetime(2000, 5, 3))
|
| 94 |
+
np.datetime64(dt.date(2000, 5, 3))
|
| 95 |
+
np.datetime64(None)
|
| 96 |
+
np.datetime64(None, "D")
|
| 97 |
+
|
| 98 |
+
np.timedelta64()
|
| 99 |
+
np.timedelta64(0)
|
| 100 |
+
np.timedelta64(0, "D")
|
| 101 |
+
np.timedelta64(0, ('ms', 3))
|
| 102 |
+
np.timedelta64(0, b"D")
|
| 103 |
+
np.timedelta64("3")
|
| 104 |
+
np.timedelta64(b"5")
|
| 105 |
+
np.timedelta64(np.timedelta64(2))
|
| 106 |
+
np.timedelta64(dt.timedelta(2))
|
| 107 |
+
np.timedelta64(None)
|
| 108 |
+
np.timedelta64(None, "D")
|
| 109 |
+
|
| 110 |
+
np.void(1)
|
| 111 |
+
np.void(np.int64(1))
|
| 112 |
+
np.void(True)
|
| 113 |
+
np.void(np.bool_(True))
|
| 114 |
+
np.void(b"test")
|
| 115 |
+
np.void(np.bytes_("test"))
|
| 116 |
+
np.void(object(), [("a", "O"), ("b", "O")])
|
| 117 |
+
np.void(object(), dtype=[("a", "O"), ("b", "O")])
|
| 118 |
+
|
| 119 |
+
# Protocols
|
| 120 |
+
i8 = np.int64()
|
| 121 |
+
u8 = np.uint64()
|
| 122 |
+
f8 = np.float64()
|
| 123 |
+
c16 = np.complex128()
|
| 124 |
+
b_ = np.bool_()
|
| 125 |
+
td = np.timedelta64()
|
| 126 |
+
U = np.str_("1")
|
| 127 |
+
S = np.bytes_("1")
|
| 128 |
+
AR = np.array(1, dtype=np.float64)
|
| 129 |
+
|
| 130 |
+
int(i8)
|
| 131 |
+
int(u8)
|
| 132 |
+
int(f8)
|
| 133 |
+
int(b_)
|
| 134 |
+
int(td)
|
| 135 |
+
int(U)
|
| 136 |
+
int(S)
|
| 137 |
+
int(AR)
|
| 138 |
+
with pytest.warns(np.ComplexWarning):
|
| 139 |
+
int(c16)
|
| 140 |
+
|
| 141 |
+
float(i8)
|
| 142 |
+
float(u8)
|
| 143 |
+
float(f8)
|
| 144 |
+
float(b_)
|
| 145 |
+
float(td)
|
| 146 |
+
float(U)
|
| 147 |
+
float(S)
|
| 148 |
+
float(AR)
|
| 149 |
+
with pytest.warns(np.ComplexWarning):
|
| 150 |
+
float(c16)
|
| 151 |
+
|
| 152 |
+
complex(i8)
|
| 153 |
+
complex(u8)
|
| 154 |
+
complex(f8)
|
| 155 |
+
complex(c16)
|
| 156 |
+
complex(b_)
|
| 157 |
+
complex(td)
|
| 158 |
+
complex(U)
|
| 159 |
+
complex(AR)
|
| 160 |
+
|
| 161 |
+
|
| 162 |
+
# Misc
|
| 163 |
+
c16.dtype
|
| 164 |
+
c16.real
|
| 165 |
+
c16.imag
|
| 166 |
+
c16.real.real
|
| 167 |
+
c16.real.imag
|
| 168 |
+
c16.ndim
|
| 169 |
+
c16.size
|
| 170 |
+
c16.itemsize
|
| 171 |
+
c16.shape
|
| 172 |
+
c16.strides
|
| 173 |
+
c16.squeeze()
|
| 174 |
+
c16.byteswap()
|
| 175 |
+
c16.transpose()
|
| 176 |
+
|
| 177 |
+
# Aliases
|
| 178 |
+
np.string_()
|
| 179 |
+
|
| 180 |
+
np.byte()
|
| 181 |
+
np.short()
|
| 182 |
+
np.intc()
|
| 183 |
+
np.intp()
|
| 184 |
+
np.int_()
|
| 185 |
+
np.longlong()
|
| 186 |
+
|
| 187 |
+
np.ubyte()
|
| 188 |
+
np.ushort()
|
| 189 |
+
np.uintc()
|
| 190 |
+
np.uintp()
|
| 191 |
+
np.uint()
|
| 192 |
+
np.ulonglong()
|
| 193 |
+
|
| 194 |
+
np.half()
|
| 195 |
+
np.single()
|
| 196 |
+
np.double()
|
| 197 |
+
np.float_()
|
| 198 |
+
np.longdouble()
|
| 199 |
+
np.longfloat()
|
| 200 |
+
|
| 201 |
+
np.csingle()
|
| 202 |
+
np.singlecomplex()
|
| 203 |
+
np.cdouble()
|
| 204 |
+
np.complex_()
|
| 205 |
+
np.cfloat()
|
| 206 |
+
np.clongdouble()
|
| 207 |
+
np.clongfloat()
|
| 208 |
+
np.longcomplex()
|
| 209 |
+
|
| 210 |
+
b.item()
|
| 211 |
+
i8.item()
|
| 212 |
+
u8.item()
|
| 213 |
+
f8.item()
|
| 214 |
+
c16.item()
|
| 215 |
+
U.item()
|
| 216 |
+
S.item()
|
| 217 |
+
|
| 218 |
+
b.tolist()
|
| 219 |
+
i8.tolist()
|
| 220 |
+
u8.tolist()
|
| 221 |
+
f8.tolist()
|
| 222 |
+
c16.tolist()
|
| 223 |
+
U.tolist()
|
| 224 |
+
S.tolist()
|
| 225 |
+
|
| 226 |
+
b.ravel()
|
| 227 |
+
i8.ravel()
|
| 228 |
+
u8.ravel()
|
| 229 |
+
f8.ravel()
|
| 230 |
+
c16.ravel()
|
| 231 |
+
U.ravel()
|
| 232 |
+
S.ravel()
|
| 233 |
+
|
| 234 |
+
b.flatten()
|
| 235 |
+
i8.flatten()
|
| 236 |
+
u8.flatten()
|
| 237 |
+
f8.flatten()
|
| 238 |
+
c16.flatten()
|
| 239 |
+
U.flatten()
|
| 240 |
+
S.flatten()
|
| 241 |
+
|
| 242 |
+
b.reshape(1)
|
| 243 |
+
i8.reshape(1)
|
| 244 |
+
u8.reshape(1)
|
| 245 |
+
f8.reshape(1)
|
| 246 |
+
c16.reshape(1)
|
| 247 |
+
U.reshape(1)
|
| 248 |
+
S.reshape(1)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/simple.py
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Simple expression that should pass with mypy."""
|
| 2 |
+
import operator
|
| 3 |
+
|
| 4 |
+
import numpy as np
|
| 5 |
+
from collections.abc import Iterable
|
| 6 |
+
|
| 7 |
+
# Basic checks
|
| 8 |
+
array = np.array([1, 2])
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
def ndarray_func(x):
|
| 12 |
+
# type: (np.ndarray) -> np.ndarray
|
| 13 |
+
return x
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
ndarray_func(np.array([1, 2]))
|
| 17 |
+
array == 1
|
| 18 |
+
array.dtype == float
|
| 19 |
+
|
| 20 |
+
# Dtype construction
|
| 21 |
+
np.dtype(float)
|
| 22 |
+
np.dtype(np.float64)
|
| 23 |
+
np.dtype(None)
|
| 24 |
+
np.dtype("float64")
|
| 25 |
+
np.dtype(np.dtype(float))
|
| 26 |
+
np.dtype(("U", 10))
|
| 27 |
+
np.dtype((np.int32, (2, 2)))
|
| 28 |
+
# Define the arguments on the previous line to prevent bidirectional
|
| 29 |
+
# type inference in mypy from broadening the types.
|
| 30 |
+
two_tuples_dtype = [("R", "u1"), ("G", "u1"), ("B", "u1")]
|
| 31 |
+
np.dtype(two_tuples_dtype)
|
| 32 |
+
|
| 33 |
+
three_tuples_dtype = [("R", "u1", 2)]
|
| 34 |
+
np.dtype(three_tuples_dtype)
|
| 35 |
+
|
| 36 |
+
mixed_tuples_dtype = [("R", "u1"), ("G", np.str_, 1)]
|
| 37 |
+
np.dtype(mixed_tuples_dtype)
|
| 38 |
+
|
| 39 |
+
shape_tuple_dtype = [("R", "u1", (2, 2))]
|
| 40 |
+
np.dtype(shape_tuple_dtype)
|
| 41 |
+
|
| 42 |
+
shape_like_dtype = [("R", "u1", (2, 2)), ("G", np.str_, 1)]
|
| 43 |
+
np.dtype(shape_like_dtype)
|
| 44 |
+
|
| 45 |
+
object_dtype = [("field1", object)]
|
| 46 |
+
np.dtype(object_dtype)
|
| 47 |
+
|
| 48 |
+
np.dtype((np.int32, (np.int8, 4)))
|
| 49 |
+
|
| 50 |
+
# Dtype comparison
|
| 51 |
+
np.dtype(float) == float
|
| 52 |
+
np.dtype(float) != np.float64
|
| 53 |
+
np.dtype(float) < None
|
| 54 |
+
np.dtype(float) <= "float64"
|
| 55 |
+
np.dtype(float) > np.dtype(float)
|
| 56 |
+
np.dtype(float) >= np.dtype(("U", 10))
|
| 57 |
+
|
| 58 |
+
# Iteration and indexing
|
| 59 |
+
def iterable_func(x):
|
| 60 |
+
# type: (Iterable) -> Iterable
|
| 61 |
+
return x
|
| 62 |
+
|
| 63 |
+
|
| 64 |
+
iterable_func(array)
|
| 65 |
+
[element for element in array]
|
| 66 |
+
iter(array)
|
| 67 |
+
zip(array, array)
|
| 68 |
+
array[1]
|
| 69 |
+
array[:]
|
| 70 |
+
array[...]
|
| 71 |
+
array[:] = 0
|
| 72 |
+
|
| 73 |
+
array_2d = np.ones((3, 3))
|
| 74 |
+
array_2d[:2, :2]
|
| 75 |
+
array_2d[..., 0]
|
| 76 |
+
array_2d[:2, :2] = 0
|
| 77 |
+
|
| 78 |
+
# Other special methods
|
| 79 |
+
len(array)
|
| 80 |
+
str(array)
|
| 81 |
+
array_scalar = np.array(1)
|
| 82 |
+
int(array_scalar)
|
| 83 |
+
float(array_scalar)
|
| 84 |
+
# currently does not work due to https://github.com/python/typeshed/issues/1904
|
| 85 |
+
# complex(array_scalar)
|
| 86 |
+
bytes(array_scalar)
|
| 87 |
+
operator.index(array_scalar)
|
| 88 |
+
bool(array_scalar)
|
| 89 |
+
|
| 90 |
+
# comparisons
|
| 91 |
+
array < 1
|
| 92 |
+
array <= 1
|
| 93 |
+
array == 1
|
| 94 |
+
array != 1
|
| 95 |
+
array > 1
|
| 96 |
+
array >= 1
|
| 97 |
+
1 < array
|
| 98 |
+
1 <= array
|
| 99 |
+
1 == array
|
| 100 |
+
1 != array
|
| 101 |
+
1 > array
|
| 102 |
+
1 >= array
|
| 103 |
+
|
| 104 |
+
# binary arithmetic
|
| 105 |
+
array + 1
|
| 106 |
+
1 + array
|
| 107 |
+
array += 1
|
| 108 |
+
|
| 109 |
+
array - 1
|
| 110 |
+
1 - array
|
| 111 |
+
array -= 1
|
| 112 |
+
|
| 113 |
+
array * 1
|
| 114 |
+
1 * array
|
| 115 |
+
array *= 1
|
| 116 |
+
|
| 117 |
+
nonzero_array = np.array([1, 2])
|
| 118 |
+
array / 1
|
| 119 |
+
1 / nonzero_array
|
| 120 |
+
float_array = np.array([1.0, 2.0])
|
| 121 |
+
float_array /= 1
|
| 122 |
+
|
| 123 |
+
array // 1
|
| 124 |
+
1 // nonzero_array
|
| 125 |
+
array //= 1
|
| 126 |
+
|
| 127 |
+
array % 1
|
| 128 |
+
1 % nonzero_array
|
| 129 |
+
array %= 1
|
| 130 |
+
|
| 131 |
+
divmod(array, 1)
|
| 132 |
+
divmod(1, nonzero_array)
|
| 133 |
+
|
| 134 |
+
array ** 1
|
| 135 |
+
1 ** array
|
| 136 |
+
array **= 1
|
| 137 |
+
|
| 138 |
+
array << 1
|
| 139 |
+
1 << array
|
| 140 |
+
array <<= 1
|
| 141 |
+
|
| 142 |
+
array >> 1
|
| 143 |
+
1 >> array
|
| 144 |
+
array >>= 1
|
| 145 |
+
|
| 146 |
+
array & 1
|
| 147 |
+
1 & array
|
| 148 |
+
array &= 1
|
| 149 |
+
|
| 150 |
+
array ^ 1
|
| 151 |
+
1 ^ array
|
| 152 |
+
array ^= 1
|
| 153 |
+
|
| 154 |
+
array | 1
|
| 155 |
+
1 | array
|
| 156 |
+
array |= 1
|
| 157 |
+
|
| 158 |
+
# unary arithmetic
|
| 159 |
+
-array
|
| 160 |
+
+array
|
| 161 |
+
abs(array)
|
| 162 |
+
~array
|
| 163 |
+
|
| 164 |
+
# Other methods
|
| 165 |
+
np.array([1, 2]).transpose()
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/data/pass/warnings_and_errors.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import numpy as np
|
| 2 |
+
|
| 3 |
+
np.AxisError("test")
|
| 4 |
+
np.AxisError(1, ndim=2)
|
| 5 |
+
np.AxisError(1, ndim=2, msg_prefix="error")
|
| 6 |
+
np.AxisError(1, ndim=2, msg_prefix=None)
|
openflamingo/lib/python3.10/site-packages/numpy/typing/tests/test_typing.py
ADDED
|
@@ -0,0 +1,300 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import importlib.util
|
| 4 |
+
import os
|
| 5 |
+
import re
|
| 6 |
+
import shutil
|
| 7 |
+
from collections import defaultdict
|
| 8 |
+
from collections.abc import Iterator
|
| 9 |
+
from typing import TYPE_CHECKING
|
| 10 |
+
|
| 11 |
+
import pytest
|
| 12 |
+
from numpy.typing.mypy_plugin import _EXTENDED_PRECISION_LIST
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# Only trigger a full `mypy` run if this environment variable is set
|
| 16 |
+
# Note that these tests tend to take over a minute even on a macOS M1 CPU,
|
| 17 |
+
# and more than that in CI.
|
| 18 |
+
RUN_MYPY = "NPY_RUN_MYPY_IN_TESTSUITE" in os.environ
|
| 19 |
+
if RUN_MYPY and RUN_MYPY not in ('0', '', 'false'):
|
| 20 |
+
RUN_MYPY = True
|
| 21 |
+
|
| 22 |
+
# Skips all functions in this file
|
| 23 |
+
pytestmark = pytest.mark.skipif(
|
| 24 |
+
not RUN_MYPY,
|
| 25 |
+
reason="`NPY_RUN_MYPY_IN_TESTSUITE` not set"
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
# Only trigger a full `mypy` run if this environment variable is set
|
| 30 |
+
# Note that these tests tend to take over a minute even on a macOS M1 CPU,
|
| 31 |
+
# and more than that in CI.
|
| 32 |
+
RUN_MYPY = "NPY_RUN_MYPY_IN_TESTSUITE" in os.environ
|
| 33 |
+
if RUN_MYPY and RUN_MYPY not in ('0', '', 'false'):
|
| 34 |
+
RUN_MYPY = True
|
| 35 |
+
|
| 36 |
+
# Skips all functions in this file
|
| 37 |
+
pytestmark = pytest.mark.skipif(
|
| 38 |
+
not RUN_MYPY,
|
| 39 |
+
reason="`NPY_RUN_MYPY_IN_TESTSUITE` not set"
|
| 40 |
+
)
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
try:
|
| 44 |
+
from mypy import api
|
| 45 |
+
except ImportError:
|
| 46 |
+
NO_MYPY = True
|
| 47 |
+
else:
|
| 48 |
+
NO_MYPY = False
|
| 49 |
+
|
| 50 |
+
if TYPE_CHECKING:
|
| 51 |
+
# We need this as annotation, but it's located in a private namespace.
|
| 52 |
+
# As a compromise, do *not* import it during runtime
|
| 53 |
+
from _pytest.mark.structures import ParameterSet
|
| 54 |
+
|
| 55 |
+
DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
|
| 56 |
+
PASS_DIR = os.path.join(DATA_DIR, "pass")
|
| 57 |
+
FAIL_DIR = os.path.join(DATA_DIR, "fail")
|
| 58 |
+
REVEAL_DIR = os.path.join(DATA_DIR, "reveal")
|
| 59 |
+
MISC_DIR = os.path.join(DATA_DIR, "misc")
|
| 60 |
+
MYPY_INI = os.path.join(DATA_DIR, "mypy.ini")
|
| 61 |
+
CACHE_DIR = os.path.join(DATA_DIR, ".mypy_cache")
|
| 62 |
+
|
| 63 |
+
#: A dictionary with file names as keys and lists of the mypy stdout as values.
|
| 64 |
+
#: To-be populated by `run_mypy`.
|
| 65 |
+
OUTPUT_MYPY: defaultdict[str, list[str]] = defaultdict(list)
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
def _key_func(key: str) -> str:
|
| 69 |
+
"""Split at the first occurrence of the ``:`` character.
|
| 70 |
+
|
| 71 |
+
Windows drive-letters (*e.g.* ``C:``) are ignored herein.
|
| 72 |
+
"""
|
| 73 |
+
drive, tail = os.path.splitdrive(key)
|
| 74 |
+
return os.path.join(drive, tail.split(":", 1)[0])
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _strip_filename(msg: str) -> tuple[int, str]:
|
| 78 |
+
"""Strip the filename and line number from a mypy message."""
|
| 79 |
+
_, tail = os.path.splitdrive(msg)
|
| 80 |
+
_, lineno, msg = tail.split(":", 2)
|
| 81 |
+
return int(lineno), msg.strip()
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def strip_func(match: re.Match[str]) -> str:
|
| 85 |
+
"""`re.sub` helper function for stripping module names."""
|
| 86 |
+
return match.groups()[1]
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
@pytest.fixture(scope="module", autouse=True)
|
| 90 |
+
def run_mypy() -> None:
|
| 91 |
+
"""Clears the cache and run mypy before running any of the typing tests.
|
| 92 |
+
|
| 93 |
+
The mypy results are cached in `OUTPUT_MYPY` for further use.
|
| 94 |
+
|
| 95 |
+
The cache refresh can be skipped using
|
| 96 |
+
|
| 97 |
+
NUMPY_TYPING_TEST_CLEAR_CACHE=0 pytest numpy/typing/tests
|
| 98 |
+
"""
|
| 99 |
+
if (
|
| 100 |
+
os.path.isdir(CACHE_DIR)
|
| 101 |
+
and bool(os.environ.get("NUMPY_TYPING_TEST_CLEAR_CACHE", True))
|
| 102 |
+
):
|
| 103 |
+
shutil.rmtree(CACHE_DIR)
|
| 104 |
+
|
| 105 |
+
split_pattern = re.compile(r"(\s+)?\^(\~+)?")
|
| 106 |
+
for directory in (PASS_DIR, REVEAL_DIR, FAIL_DIR, MISC_DIR):
|
| 107 |
+
# Run mypy
|
| 108 |
+
stdout, stderr, exit_code = api.run([
|
| 109 |
+
"--config-file",
|
| 110 |
+
MYPY_INI,
|
| 111 |
+
"--cache-dir",
|
| 112 |
+
CACHE_DIR,
|
| 113 |
+
directory,
|
| 114 |
+
])
|
| 115 |
+
if stderr:
|
| 116 |
+
pytest.fail(f"Unexpected mypy standard error\n\n{stderr}")
|
| 117 |
+
elif exit_code not in {0, 1}:
|
| 118 |
+
pytest.fail(f"Unexpected mypy exit code: {exit_code}\n\n{stdout}")
|
| 119 |
+
|
| 120 |
+
str_concat = ""
|
| 121 |
+
filename: str | None = None
|
| 122 |
+
for i in stdout.split("\n"):
|
| 123 |
+
if "note:" in i:
|
| 124 |
+
continue
|
| 125 |
+
if filename is None:
|
| 126 |
+
filename = _key_func(i)
|
| 127 |
+
|
| 128 |
+
str_concat += f"{i}\n"
|
| 129 |
+
if split_pattern.match(i) is not None:
|
| 130 |
+
OUTPUT_MYPY[filename].append(str_concat)
|
| 131 |
+
str_concat = ""
|
| 132 |
+
filename = None
|
| 133 |
+
|
| 134 |
+
|
| 135 |
+
def get_test_cases(directory: str) -> Iterator[ParameterSet]:
|
| 136 |
+
for root, _, files in os.walk(directory):
|
| 137 |
+
for fname in files:
|
| 138 |
+
short_fname, ext = os.path.splitext(fname)
|
| 139 |
+
if ext in (".pyi", ".py"):
|
| 140 |
+
fullpath = os.path.join(root, fname)
|
| 141 |
+
yield pytest.param(fullpath, id=short_fname)
|
| 142 |
+
|
| 143 |
+
|
| 144 |
+
@pytest.mark.slow
|
| 145 |
+
@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
|
| 146 |
+
@pytest.mark.parametrize("path", get_test_cases(PASS_DIR))
|
| 147 |
+
def test_success(path) -> None:
|
| 148 |
+
# Alias `OUTPUT_MYPY` so that it appears in the local namespace
|
| 149 |
+
output_mypy = OUTPUT_MYPY
|
| 150 |
+
if path in output_mypy:
|
| 151 |
+
msg = "Unexpected mypy output\n\n"
|
| 152 |
+
msg += "\n".join(_strip_filename(v)[1] for v in output_mypy[path])
|
| 153 |
+
raise AssertionError(msg)
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
@pytest.mark.slow
|
| 157 |
+
@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
|
| 158 |
+
@pytest.mark.parametrize("path", get_test_cases(FAIL_DIR))
|
| 159 |
+
def test_fail(path: str) -> None:
|
| 160 |
+
__tracebackhide__ = True
|
| 161 |
+
|
| 162 |
+
with open(path) as fin:
|
| 163 |
+
lines = fin.readlines()
|
| 164 |
+
|
| 165 |
+
errors = defaultdict(lambda: "")
|
| 166 |
+
|
| 167 |
+
output_mypy = OUTPUT_MYPY
|
| 168 |
+
assert path in output_mypy
|
| 169 |
+
|
| 170 |
+
for error_line in output_mypy[path]:
|
| 171 |
+
lineno, error_line = _strip_filename(error_line)
|
| 172 |
+
errors[lineno] += f'{error_line}\n'
|
| 173 |
+
|
| 174 |
+
for i, line in enumerate(lines):
|
| 175 |
+
lineno = i + 1
|
| 176 |
+
if (
|
| 177 |
+
line.startswith('#')
|
| 178 |
+
or (" E:" not in line and lineno not in errors)
|
| 179 |
+
):
|
| 180 |
+
continue
|
| 181 |
+
|
| 182 |
+
target_line = lines[lineno - 1]
|
| 183 |
+
if "# E:" in target_line:
|
| 184 |
+
expression, _, marker = target_line.partition(" # E: ")
|
| 185 |
+
expected_error = errors[lineno].strip()
|
| 186 |
+
marker = marker.strip()
|
| 187 |
+
_test_fail(path, expression, marker, expected_error, lineno)
|
| 188 |
+
else:
|
| 189 |
+
pytest.fail(
|
| 190 |
+
f"Unexpected mypy output at line {lineno}\n\n{errors[lineno]}"
|
| 191 |
+
)
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
_FAIL_MSG1 = """Extra error at line {}
|
| 195 |
+
|
| 196 |
+
Expression: {}
|
| 197 |
+
Extra error: {!r}
|
| 198 |
+
"""
|
| 199 |
+
|
| 200 |
+
_FAIL_MSG2 = """Error mismatch at line {}
|
| 201 |
+
|
| 202 |
+
Expression: {}
|
| 203 |
+
Expected error: {}
|
| 204 |
+
Observed error: {!r}
|
| 205 |
+
"""
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
def _test_fail(
|
| 209 |
+
path: str,
|
| 210 |
+
expression: str,
|
| 211 |
+
error: str,
|
| 212 |
+
expected_error: None | str,
|
| 213 |
+
lineno: int,
|
| 214 |
+
) -> None:
|
| 215 |
+
if expected_error is None:
|
| 216 |
+
raise AssertionError(_FAIL_MSG1.format(lineno, expression, error))
|
| 217 |
+
elif error not in expected_error:
|
| 218 |
+
raise AssertionError(_FAIL_MSG2.format(
|
| 219 |
+
lineno, expression, expected_error, error
|
| 220 |
+
))
|
| 221 |
+
|
| 222 |
+
|
| 223 |
+
_REVEAL_MSG = """Reveal mismatch at line {}
|
| 224 |
+
|
| 225 |
+
{}
|
| 226 |
+
"""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
@pytest.mark.slow
|
| 230 |
+
@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
|
| 231 |
+
@pytest.mark.parametrize("path", get_test_cases(REVEAL_DIR))
|
| 232 |
+
def test_reveal(path: str) -> None:
|
| 233 |
+
"""Validate that mypy correctly infers the return-types of
|
| 234 |
+
the expressions in `path`.
|
| 235 |
+
"""
|
| 236 |
+
__tracebackhide__ = True
|
| 237 |
+
|
| 238 |
+
output_mypy = OUTPUT_MYPY
|
| 239 |
+
if path not in output_mypy:
|
| 240 |
+
return
|
| 241 |
+
|
| 242 |
+
for error_line in output_mypy[path]:
|
| 243 |
+
lineno, error_line = _strip_filename(error_line)
|
| 244 |
+
raise AssertionError(_REVEAL_MSG.format(lineno, error_line))
|
| 245 |
+
|
| 246 |
+
|
| 247 |
+
@pytest.mark.slow
|
| 248 |
+
@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
|
| 249 |
+
@pytest.mark.parametrize("path", get_test_cases(PASS_DIR))
|
| 250 |
+
def test_code_runs(path: str) -> None:
|
| 251 |
+
"""Validate that the code in `path` properly during runtime."""
|
| 252 |
+
path_without_extension, _ = os.path.splitext(path)
|
| 253 |
+
dirname, filename = path.split(os.sep)[-2:]
|
| 254 |
+
|
| 255 |
+
spec = importlib.util.spec_from_file_location(
|
| 256 |
+
f"{dirname}.{filename}", path
|
| 257 |
+
)
|
| 258 |
+
assert spec is not None
|
| 259 |
+
assert spec.loader is not None
|
| 260 |
+
|
| 261 |
+
test_module = importlib.util.module_from_spec(spec)
|
| 262 |
+
spec.loader.exec_module(test_module)
|
| 263 |
+
|
| 264 |
+
|
| 265 |
+
LINENO_MAPPING = {
|
| 266 |
+
11: "uint128",
|
| 267 |
+
12: "uint256",
|
| 268 |
+
14: "int128",
|
| 269 |
+
15: "int256",
|
| 270 |
+
17: "float80",
|
| 271 |
+
18: "float96",
|
| 272 |
+
19: "float128",
|
| 273 |
+
20: "float256",
|
| 274 |
+
22: "complex160",
|
| 275 |
+
23: "complex192",
|
| 276 |
+
24: "complex256",
|
| 277 |
+
25: "complex512",
|
| 278 |
+
}
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
@pytest.mark.slow
|
| 282 |
+
@pytest.mark.skipif(NO_MYPY, reason="Mypy is not installed")
|
| 283 |
+
def test_extended_precision() -> None:
|
| 284 |
+
path = os.path.join(MISC_DIR, "extended_precision.pyi")
|
| 285 |
+
output_mypy = OUTPUT_MYPY
|
| 286 |
+
assert path in output_mypy
|
| 287 |
+
|
| 288 |
+
with open(path) as f:
|
| 289 |
+
expression_list = f.readlines()
|
| 290 |
+
|
| 291 |
+
for _msg in output_mypy[path]:
|
| 292 |
+
lineno, msg = _strip_filename(_msg)
|
| 293 |
+
expression = expression_list[lineno - 1].rstrip("\n")
|
| 294 |
+
|
| 295 |
+
if LINENO_MAPPING[lineno] in _EXTENDED_PRECISION_LIST:
|
| 296 |
+
raise AssertionError(_REVEAL_MSG.format(lineno, msg))
|
| 297 |
+
elif "error" not in msg:
|
| 298 |
+
_test_fail(
|
| 299 |
+
path, expression, msg, 'Expression is of type "Any"', lineno
|
| 300 |
+
)
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_stmts.f90
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
! gh-23276
|
| 2 |
+
module cmplxdat
|
| 3 |
+
implicit none
|
| 4 |
+
integer :: i, j
|
| 5 |
+
real :: x, y
|
| 6 |
+
real, dimension(2) :: z
|
| 7 |
+
real(kind=8) :: pi
|
| 8 |
+
complex(kind=8), target :: medium_ref_index
|
| 9 |
+
complex(kind=8), target :: ref_index_one, ref_index_two
|
| 10 |
+
complex(kind=8), dimension(2) :: my_array
|
| 11 |
+
real(kind=8), dimension(3) :: my_real_array = (/1.0d0, 2.0d0, 3.0d0/)
|
| 12 |
+
|
| 13 |
+
data i, j / 2, 3 /
|
| 14 |
+
data x, y / 1.5, 2.0 /
|
| 15 |
+
data z / 3.5, 7.0 /
|
| 16 |
+
data medium_ref_index / (1.d0, 0.d0) /
|
| 17 |
+
data ref_index_one, ref_index_two / (13.0d0, 21.0d0), (-30.0d0, 43.0d0) /
|
| 18 |
+
data my_array / (1.0d0, 2.0d0), (-3.0d0, 4.0d0) /
|
| 19 |
+
data pi / 3.1415926535897932384626433832795028841971693993751058209749445923078164062d0 /
|
| 20 |
+
end module cmplxdat
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/data_with_comments.f
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
BLOCK DATA PARAM_INI
|
| 2 |
+
COMMON /MYCOM/ MYTAB
|
| 3 |
+
INTEGER MYTAB(3)
|
| 4 |
+
DATA MYTAB/
|
| 5 |
+
* 0, ! 1 and more commenty stuff
|
| 6 |
+
* 4, ! 2
|
| 7 |
+
* 0 /
|
| 8 |
+
END
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/foo_deps.f90
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module foo
|
| 2 |
+
type bar
|
| 3 |
+
character(len = 4) :: text
|
| 4 |
+
end type bar
|
| 5 |
+
type(bar), parameter :: abar = bar('abar')
|
| 6 |
+
end module foo
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/gh23598Warn.f90
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module test_bug
|
| 2 |
+
implicit none
|
| 3 |
+
private
|
| 4 |
+
public :: intproduct
|
| 5 |
+
|
| 6 |
+
contains
|
| 7 |
+
integer function intproduct(a, b) result(res)
|
| 8 |
+
integer, intent(in) :: a, b
|
| 9 |
+
res = a*b
|
| 10 |
+
end function
|
| 11 |
+
end module
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/crackfortran/pubprivmod.f90
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module foo
|
| 2 |
+
public
|
| 3 |
+
integer, private :: a
|
| 4 |
+
integer :: b
|
| 5 |
+
contains
|
| 6 |
+
subroutine setA(v)
|
| 7 |
+
integer, intent(in) :: v
|
| 8 |
+
a = v
|
| 9 |
+
end subroutine setA
|
| 10 |
+
end module foo
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/negative_bounds/issue_20853.f90
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
subroutine foo(is_, ie_, arr, tout)
|
| 2 |
+
implicit none
|
| 3 |
+
integer :: is_,ie_
|
| 4 |
+
real, intent(in) :: arr(is_:ie_)
|
| 5 |
+
real, intent(out) :: tout(is_:ie_)
|
| 6 |
+
tout = arr
|
| 7 |
+
end
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_character/foo77.f
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
function t0(value)
|
| 2 |
+
character value
|
| 3 |
+
character t0
|
| 4 |
+
t0 = value
|
| 5 |
+
end
|
| 6 |
+
function t1(value)
|
| 7 |
+
character*1 value
|
| 8 |
+
character*1 t1
|
| 9 |
+
t1 = value
|
| 10 |
+
end
|
| 11 |
+
function t5(value)
|
| 12 |
+
character*5 value
|
| 13 |
+
character*5 t5
|
| 14 |
+
t5 = value
|
| 15 |
+
end
|
| 16 |
+
function ts(value)
|
| 17 |
+
character*(*) value
|
| 18 |
+
character*(*) ts
|
| 19 |
+
ts = value
|
| 20 |
+
end
|
| 21 |
+
|
| 22 |
+
subroutine s0(t0,value)
|
| 23 |
+
character value
|
| 24 |
+
character t0
|
| 25 |
+
cf2py intent(out) t0
|
| 26 |
+
t0 = value
|
| 27 |
+
end
|
| 28 |
+
subroutine s1(t1,value)
|
| 29 |
+
character*1 value
|
| 30 |
+
character*1 t1
|
| 31 |
+
cf2py intent(out) t1
|
| 32 |
+
t1 = value
|
| 33 |
+
end
|
| 34 |
+
subroutine s5(t5,value)
|
| 35 |
+
character*5 value
|
| 36 |
+
character*5 t5
|
| 37 |
+
cf2py intent(out) t5
|
| 38 |
+
t5 = value
|
| 39 |
+
end
|
| 40 |
+
subroutine ss(ts,value)
|
| 41 |
+
character*(*) value
|
| 42 |
+
character*10 ts
|
| 43 |
+
cf2py intent(out) ts
|
| 44 |
+
ts = value
|
| 45 |
+
end
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_character/foo90.f90
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
module f90_return_char
|
| 2 |
+
contains
|
| 3 |
+
function t0(value)
|
| 4 |
+
character :: value
|
| 5 |
+
character :: t0
|
| 6 |
+
t0 = value
|
| 7 |
+
end function t0
|
| 8 |
+
function t1(value)
|
| 9 |
+
character(len=1) :: value
|
| 10 |
+
character(len=1) :: t1
|
| 11 |
+
t1 = value
|
| 12 |
+
end function t1
|
| 13 |
+
function t5(value)
|
| 14 |
+
character(len=5) :: value
|
| 15 |
+
character(len=5) :: t5
|
| 16 |
+
t5 = value
|
| 17 |
+
end function t5
|
| 18 |
+
function ts(value)
|
| 19 |
+
character(len=*) :: value
|
| 20 |
+
character(len=10) :: ts
|
| 21 |
+
ts = value
|
| 22 |
+
end function ts
|
| 23 |
+
|
| 24 |
+
subroutine s0(t0,value)
|
| 25 |
+
character :: value
|
| 26 |
+
character :: t0
|
| 27 |
+
!f2py intent(out) t0
|
| 28 |
+
t0 = value
|
| 29 |
+
end subroutine s0
|
| 30 |
+
subroutine s1(t1,value)
|
| 31 |
+
character(len=1) :: value
|
| 32 |
+
character(len=1) :: t1
|
| 33 |
+
!f2py intent(out) t1
|
| 34 |
+
t1 = value
|
| 35 |
+
end subroutine s1
|
| 36 |
+
subroutine s5(t5,value)
|
| 37 |
+
character(len=5) :: value
|
| 38 |
+
character(len=5) :: t5
|
| 39 |
+
!f2py intent(out) t5
|
| 40 |
+
t5 = value
|
| 41 |
+
end subroutine s5
|
| 42 |
+
subroutine ss(ts,value)
|
| 43 |
+
character(len=*) :: value
|
| 44 |
+
character(len=10) :: ts
|
| 45 |
+
!f2py intent(out) ts
|
| 46 |
+
ts = value
|
| 47 |
+
end subroutine ss
|
| 48 |
+
end module f90_return_char
|
phi4/lib/python3.10/site-packages/numpy/f2py/tests/src/return_real/foo77.f
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
function t0(value)
|
| 2 |
+
real value
|
| 3 |
+
real t0
|
| 4 |
+
t0 = value
|
| 5 |
+
end
|
| 6 |
+
function t4(value)
|
| 7 |
+
real*4 value
|
| 8 |
+
real*4 t4
|
| 9 |
+
t4 = value
|
| 10 |
+
end
|
| 11 |
+
function t8(value)
|
| 12 |
+
real*8 value
|
| 13 |
+
real*8 t8
|
| 14 |
+
t8 = value
|
| 15 |
+
end
|
| 16 |
+
function td(value)
|
| 17 |
+
double precision value
|
| 18 |
+
double precision td
|
| 19 |
+
td = value
|
| 20 |
+
end
|
| 21 |
+
|
| 22 |
+
subroutine s0(t0,value)
|
| 23 |
+
real value
|
| 24 |
+
real t0
|
| 25 |
+
cf2py intent(out) t0
|
| 26 |
+
t0 = value
|
| 27 |
+
end
|
| 28 |
+
subroutine s4(t4,value)
|
| 29 |
+
real*4 value
|
| 30 |
+
real*4 t4
|
| 31 |
+
cf2py intent(out) t4
|
| 32 |
+
t4 = value
|
| 33 |
+
end
|
| 34 |
+
subroutine s8(t8,value)
|
| 35 |
+
real*8 value
|
| 36 |
+
real*8 t8
|
| 37 |
+
cf2py intent(out) t8
|
| 38 |
+
t8 = value
|
| 39 |
+
end
|
| 40 |
+
subroutine sd(td,value)
|
| 41 |
+
double precision value
|
| 42 |
+
double precision td
|
| 43 |
+
cf2py intent(out) td
|
| 44 |
+
td = value
|
| 45 |
+
end
|