Search is not available for this dataset
repo_id stringlengths 12 110 | file_path stringlengths 24 164 | content stringlengths 3 89.3M | __index_level_0__ int64 0 0 |
|---|---|---|---|
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/comparisons.py | from __future__ import annotations
from typing import Any
import numpy as np
c16 = np.complex128()
f8 = np.float64()
i8 = np.int64()
u8 = np.uint64()
c8 = np.complex64()
f4 = np.float32()
i4 = np.int32()
u4 = np.uint32()
dt = np.datetime64(0, "D")
td = np.timedelta64(0, "D")
b_ = np.bool_()
b = bool()
c = complex... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/dtype.py | import numpy as np
dtype_obj = np.dtype(np.str_)
void_dtype_obj = np.dtype([("f0", np.float64), ("f1", np.float32)])
np.dtype(dtype=np.int64)
np.dtype(int)
np.dtype("int")
np.dtype(None)
np.dtype((int, 2))
np.dtype((int, (1,)))
np.dtype({"names": ["a", "b"], "formats": [int, float]})
np.dtype({"names": ["a"], "form... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/bitwise_ops.py | import numpy as np
i8 = np.int64(1)
u8 = np.uint64(1)
i4 = np.int32(1)
u4 = np.uint32(1)
b_ = np.bool_(1)
b = bool(1)
i = int(1)
AR = np.array([0, 1, 2], dtype=np.int32)
AR.setflags(write=False)
i8 << i8
i8 >> i8
i8 | i8
i8 ^ i8
i8 & i8
i << AR
i >> AR
i | AR
i ^ AR
i & AR
i8 << AR
i8 >> AR
i8 | AR
i8 ^ AR
i8 ... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/array_constructors.py | from typing import Any
import numpy as np
import numpy.typing as npt
class Index:
def __index__(self) -> int:
return 0
class SubClass(npt.NDArray[np.float64]):
pass
def func(i: int, j: int, **kwargs: Any) -> SubClass:
return B
i8 = np.int64(1)
A = np.array([1])
B = A.view(SubClass).copy()
B... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/numerictypes.py | import numpy as np
np.issubdtype("S1", np.bytes_)
np.issubdtype(np.float64, np.float32)
np.ScalarType
np.ScalarType[0]
np.ScalarType[3]
np.ScalarType[8]
np.ScalarType[10]
np.typecodes["Character"]
np.typecodes["Complex"]
np.typecodes["All"]
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/flatiter.py | import numpy as np
a = np.empty((2, 2)).flat
a.base
a.copy()
a.coords
a.index
iter(a)
next(a)
a[0]
a[[0, 1, 2]]
a[...]
a[:]
a.__array__()
a.__array__(np.dtype(np.float64))
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ufunc_config.py | """Typing tests for `numpy._core._ufunc_config`."""
import numpy as np
def func1(a: str, b: int) -> None:
return None
def func2(a: str, b: int, c: float = 1.0) -> None:
return None
def func3(a: str, b: int) -> int:
return 0
class Write1:
def write(self, a: str) -> None:
return None
cl... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/modules.py | import numpy as np
from numpy import f2py
np.char
np.ctypeslib
np.emath
np.fft
np.lib
np.linalg
np.ma
np.matrixlib
np.polynomial
np.random
np.rec
np.testing
np.version
np.lib.format
np.lib.mixins
np.lib.scimath
np.lib.stride_tricks
np.lib.array_utils
np.ma.extras
np.polynomial.chebyshev
np.polynomial.hermite
np.polyn... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/mod.py | import numpy as np
f8 = np.float64(1)
i8 = np.int64(1)
u8 = np.uint64(1)
f4 = np.float32(1)
i4 = np.int32(1)
u4 = np.uint32(1)
td = np.timedelta64(1, "D")
b_ = np.bool_(1)
b = bool(1)
f = float(1)
i = int(1)
AR = np.array([1], dtype=np.bool_)
AR.setflags(write=False)
AR2 = np.array([1], dtype=np.timedelta64)
AR2.... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ndarray_misc.py | """
Tests for miscellaneous (non-magic) ``np.ndarray``/``np.generic`` methods.
More extensive tests are performed for the methods'
function-based counterpart in `../from_numeric.py`.
"""
from __future__ import annotations
import operator
from typing import cast, Any
import numpy as np
import numpy.typing as npt
c... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/scalars.py | import sys
import datetime as dt
import pytest
import numpy as np
b = np.bool_()
u8 = np.uint64()
i8 = np.int64()
f8 = np.float64()
c16 = np.complex128()
U = np.str_()
S = np.bytes_()
# Construction
class D:
def __index__(self) -> int:
return 0
class C:
def __complex__(self) -> complex:
r... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/simple.py | """Simple expression that should pass with mypy."""
import operator
import numpy as np
import numpy.typing as npt
from collections.abc import Iterable
# Basic checks
array = np.array([1, 2])
def ndarray_func(x: npt.NDArray[np.float64]) -> npt.NDArray[np.float64]:
return x
ndarray_func(np.array([1, 2], dtype=n... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/warnings_and_errors.py | import numpy.exceptions as ex
ex.AxisError("test")
ex.AxisError(1, ndim=2)
ex.AxisError(1, ndim=2, msg_prefix="error")
ex.AxisError(1, ndim=2, msg_prefix=None)
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ufuncs.py | import numpy as np
np.sin(1)
np.sin([1, 2, 3])
np.sin(1, out=np.empty(1))
np.matmul(np.ones((2, 2, 2)), np.ones((2, 2, 2)), axes=[(0, 1), (0, 1), (0, 1)])
np.sin(1, signature="D->D")
# NOTE: `np.generic` subclasses are not guaranteed to support addition;
# re-enable this we can infer the exact return type of `np.sin(.... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ufunclike.py | from __future__ import annotations
from typing import Any
import numpy as np
class Object:
def __ceil__(self) -> Object:
return self
def __floor__(self) -> Object:
return self
def __ge__(self, value: object) -> bool:
return True
def __array__(self) -> np.ndarray[Any, np.dtyp... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/numeric.py | """
Tests for :mod:`numpy._core.numeric`.
Does not include tests which fall under ``array_constructors``.
"""
from __future__ import annotations
import numpy as np
import numpy.typing as npt
class SubClass(npt.NDArray[np.float64]):
...
i8 = np.int64(1)
A = np.arange(27).reshape(3, 3, 3)
B: list[list[list[int... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/random.py | from __future__ import annotations
from typing import Any
import numpy as np
SEED_NONE = None
SEED_INT = 4579435749574957634658964293569
SEED_ARR: np.ndarray[Any, np.dtype[np.int64]] = np.array([1, 2, 3, 4], dtype=np.int64)
SEED_ARRLIKE: list[int] = [1, 2, 3, 4]
SEED_SEED_SEQ: np.random.SeedSequence = np.random.SeedS... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/lib_version.py | from numpy.lib import NumpyVersion
version = NumpyVersion("1.8.0")
version.vstring
version.version
version.major
version.minor
version.bugfix
version.pre_release
version.is_devversion
version == version
version != version
version < "1.8.0"
version <= version
version > version
version >= "1.8.0"
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/index_tricks.py | from __future__ import annotations
from typing import Any
import numpy as np
AR_LIKE_b = [[True, True], [True, True]]
AR_LIKE_i = [[1, 2], [3, 4]]
AR_LIKE_f = [[1.0, 2.0], [3.0, 4.0]]
AR_LIKE_U = [["1", "2"], ["3", "4"]]
AR_i8: np.ndarray[Any, np.dtype[np.int64]] = np.array(AR_LIKE_i, dtype=np.int64)
np.ndenumerate(... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/arithmetic.py | from __future__ import annotations
from typing import Any
import numpy as np
import pytest
c16 = np.complex128(1)
f8 = np.float64(1)
i8 = np.int64(1)
u8 = np.uint64(1)
c8 = np.complex64(1)
f4 = np.float32(1)
i4 = np.int32(1)
u4 = np.uint32(1)
dt = np.datetime64(1, "D")
td = np.timedelta64(1, "D")
b_ = np.bool_(1)
... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/multiarray.py | import numpy as np
import numpy.typing as npt
AR_f8: npt.NDArray[np.float64] = np.array([1.0])
AR_i4 = np.array([1], dtype=np.int32)
AR_u1 = np.array([1], dtype=np.uint8)
AR_LIKE_f = [1.5]
AR_LIKE_i = [1]
b_f8 = np.broadcast(AR_f8)
b_i4_f8_f8 = np.broadcast(AR_i4, AR_f8, AR_f8)
next(b_f8)
b_f8.reset()
b_f8.index
b_... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/fromnumeric.py | """Tests for :mod:`numpy._core.fromnumeric`."""
import numpy as np
A = np.array(True, ndmin=2, dtype=bool)
B = np.array(1.0, ndmin=2, dtype=np.float32)
A.setflags(write=False)
B.setflags(write=False)
a = np.bool_(True)
b = np.float32(1.0)
c = 1.0
d = np.array(1.0, dtype=np.float32) # writeable
np.take(a, 0)
np.tak... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/literal.py | from __future__ import annotations
from typing import Any
from functools import partial
from collections.abc import Callable
import pytest
import numpy as np
AR = np.array(0)
AR.setflags(write=False)
KACF = frozenset({None, "K", "A", "C", "F"})
ACF = frozenset({None, "A", "C", "F"})
CF = frozenset({None, "C", "F"})... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/simple_py3.py | import numpy as np
array = np.array([1, 2])
# The @ operator is not in python 2
array @ array
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/arrayterator.py |
from __future__ import annotations
from typing import Any
import numpy as np
AR_i8: np.ndarray[Any, np.dtype[np.int_]] = np.arange(10)
ar_iter = np.lib.Arrayterator(AR_i8)
ar_iter.var
ar_iter.buf_size
ar_iter.start
ar_iter.stop
ar_iter.step
ar_iter.shape
ar_iter.flat
ar_iter.__array__()
for i in ar_iter:
pass... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ndarray_shape_manipulation.py | import numpy as np
nd1 = np.array([[1, 2], [3, 4]])
# reshape
nd1.reshape(4)
nd1.reshape(2, 2)
nd1.reshape((2, 2))
nd1.reshape((2, 2), order="C")
nd1.reshape(4, order="C")
# resize
nd1.resize()
nd1.resize(4)
nd1.resize(2, 2)
nd1.resize((2, 2))
nd1.resize((2, 2), refcheck=True)
nd1.resize(4, refcheck=True)
nd2 = n... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/arrayprint.py | import numpy as np
AR = np.arange(10)
AR.setflags(write=False)
with np.printoptions():
np.set_printoptions(
precision=1,
threshold=2,
edgeitems=3,
linewidth=4,
suppress=False,
nanstr="Bob",
infstr="Bill",
formatter={},
sign="+",
float... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/lib_utils.py | from __future__ import annotations
from io import StringIO
import numpy as np
import numpy.lib.array_utils as array_utils
FILE = StringIO()
AR = np.arange(10, dtype=np.float64)
def func(a: int) -> bool:
return True
array_utils.byte_bounds(AR)
array_utils.byte_bounds(np.float64())
np.info(1, output=FILE)
| 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/ndarray_conversion.py | import os
import tempfile
import numpy as np
nd = np.array([[1, 2], [3, 4]])
scalar_array = np.array(1)
# item
scalar_array.item()
nd.item(1)
nd.item(0, 1)
nd.item((0, 1))
# tobytes
nd.tobytes()
nd.tobytes("C")
nd.tobytes(None)
# tofile
if os.name != "nt":
with tempfile.NamedTemporaryFile(suffix=".txt") as tmp... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/pass/array_like.py | from __future__ import annotations
from typing import Any
import numpy as np
from numpy._typing import NDArray, ArrayLike, _SupportsArray
x1: ArrayLike = True
x2: ArrayLike = 5
x3: ArrayLike = 1.0
x4: ArrayLike = 1 + 1j
x5: ArrayLike = np.int8(1)
x6: ArrayLike = np.float64(1)
x7: ArrayLike = np.complex128(1)
x8: Arr... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/histograms.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_i8: npt.NDArray[np.int64]
AR_f8: npt.NDArray[np.float64]
assert_type(np.histogram_bin_edges(AR_i8, bins="auto"), n... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/lib_utils.pyi | import sys
from io import StringIO
import numpy as np
import numpy.typing as npt
import numpy.lib.array_utils as array_utils
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR: npt.NDArray[np.float64]
AR_DICT: dict[str, npt.NDArray[np.float64]]
F... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/lib_function_base.pyi | import sys
from typing import Any
from collections.abc import Callable
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
vectorized_func: np.vectorize
f8: np.float64
AR_LIKE_f8: list[float]
AR_i8: npt... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/flatiter.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
a: np.flatiter[npt.NDArray[np.str_]]
assert_type(a.base, npt.NDArray[np.str_])
assert_type(a.copy(), npt.NDArray[np.s... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/arrayterator.pyi | import sys
from typing import Any
from collections.abc import Generator
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_i8: npt.NDArray[np.int64]
ar_iter = np.lib.Arrayterator(AR_i8)
assert_type(a... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/fft.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_f8: npt.NDArray[np.float64]
AR_c16: npt.NDArray[np.complex128]
AR_LIKE_f8: list[float]
assert_type(np.fft.fftshift... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/array_constructors.pyi | import sys
from typing import Any, TypeVar
from pathlib import Path
from collections import deque
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
_SCT = TypeVar("_SCT", bound=np.generic, covariant=Tru... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/chararray.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_U: np.char.chararray[Any, np.dtype[np.str_]]
AR_S: np.char.chararray[Any, np.dtype[np.bytes_]]
assert_type(AR_U ==... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/index_tricks.pyi | import sys
from typing import Any, Literal
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_LIKE_b: list[bool]
AR_LIKE_i: list[int]
AR_LIKE_f: list[float]
AR_LIKE_U: list[str]
AR_i8: npt.NDArray[np... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/scalars.pyi | import sys
from typing import Any, Literal
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
b: np.bool_
u8: np.uint64
i8: np.int64
f8: np.float64
c8: np.complex64
c16: np.complex128
m: np.timedelta64
U... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/comparisons.pyi | import sys
import fractions
import decimal
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
c16 = np.complex128()
f8 = np.float64()
i8 = np.int64()
u8 = np.uint64()
c8 = np.comp... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/lib_version.pyi | import sys
from numpy.lib import NumpyVersion
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
version = NumpyVersion("1.8.0")
assert_type(version.vstring, str)
assert_type(version.version, str)
assert_type(version.major, int)
assert_type(version... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/constants.pyi | import sys
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
assert_type(np.e, float)
assert_type(np.euler_gamma, float)
assert_type(np.inf, float)
assert_type(np.nan, float)
assert_type(np.pi, float)
assert_type(np.little_endia... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/emath.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_f8: npt.NDArray[np.float64]
AR_c16: npt.NDArray[np.complex128]
f8: np.float64
c16: np.complex128
assert_type(np.em... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/linalg.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy.linalg._linalg import (
QRResult, EigResult, EighResult, SVDResult, SlogdetResult
)
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_i8: npt.NDArray[... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ufunc_config.pyi | """Typing tests for `_core._ufunc_config`."""
import sys
from typing import Any, Protocol
from collections.abc import Callable
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
def func(a: str, b: int) -> None: ...
class Write:... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/fromnumeric.pyi | """Tests for :mod:`_core.fromnumeric`."""
import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
class NDArraySubclass(npt.NDArray[np.complex128]):
...
AR_b: npt.NDArr... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/bitwise_ops.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy._typing import _64Bit, _32Bit
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
i8 = np.int64(1)
u8 = np.uint64(1)
i4 = np.int32(1)
u4 = np.uint32(1)
b_ = ... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/numerictypes.pyi | import sys
from typing import Literal
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
assert_type(
np.ScalarType,
tuple[
type[int],
type[float],
type[complex],
type[bool],
type[by... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/memmap.pyi | import sys
from typing import Any
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
memmap_obj: np.memmap[Any, np.dtype[np.str_]]
assert_type(np.memmap.__array_priority__, float)
assert_type(memmap_obj.__array_priority__, float)... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/numeric.pyi | """
Tests for :mod:`_core.numeric`.
Does not include tests which fall under ``array_constructors``.
"""
import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
class SubCl... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/nditer.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
nditer_obj: np.nditer
assert_type(np.nditer([0, 1], flags=["c_index"]), np.nditer)
assert_type(np.nditer([0, 1], op_f... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/type_check.pyi | import sys
from typing import Any, Literal
import numpy as np
import numpy.typing as npt
from numpy._typing import _16Bit, _32Bit, _64Bit, _128Bit
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
f8: np.float64
f: float
# NOTE: Avoid importing th... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/random.pyi | import sys
import threading
from typing import Any
from collections.abc import Sequence
import numpy as np
import numpy.typing as npt
from numpy.random._generator import Generator
from numpy.random._mt19937 import MT19937
from numpy.random._pcg64 import PCG64
from numpy.random._sfc64 import SFC64
from numpy.random._ph... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/shape_base.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
i8: np.int64
f8: np.float64
AR_b: npt.NDArray[np.bool_]
AR_i8: npt.NDArray[np.int64]
AR_f8: npt.NDArray[np.float64]
... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/char.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_U: npt.NDArray[np.str_]
AR_S: npt.NDArray[np.bytes_]
assert_type(np.char.equal(AR_U, AR_U), npt.NDArray[np.bool_])... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/einsumfunc.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_LIKE_b: list[bool]
AR_LIKE_u: list[np.uint32]
AR_LIKE_i: list[int]
AR_LIKE_f: list[float]
AR_LIKE_c: list[complex]
... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/npyio.pyi | import re
import sys
import zipfile
import pathlib
from typing import IO, Any
from collections.abc import Mapping
import numpy.typing as npt
import numpy as np
from numpy.lib._npyio_impl import BagObj
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_typ... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/arraysetops.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_b: npt.NDArray[np.bool_]
AR_i8: npt.NDArray[np.int64]
AR_f8: npt.NDArray[np.float64]
AR_M: npt.NDArray[np.datetime6... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ctypeslib.pyi | import sys
import ctypes as ct
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy import ctypeslib
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_bool: npt.NDArray[np.bool_]
AR_ubyte: npt.NDArray[np.ubyte]
AR_usho... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/warnings_and_errors.pyi | import sys
import numpy.exceptions as ex
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
assert_type(ex.ModuleDeprecationWarning(), ex.ModuleDeprecationWarning)
assert_type(ex.VisibleDeprecationWarning(), ex.VisibleDeprecationWarning)
assert_type... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/stride_tricks.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_f8: npt.NDArray[np.float64]
AR_LIKE_f: list[float]
interface_dict: dict[str, Any]
assert_type(np.lib.stride_tricks... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ufunclike.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_LIKE_b: list[bool]
AR_LIKE_u: list[np.uint32]
AR_LIKE_i: list[int]
AR_LIKE_f: list[float]
AR_LIKE_O: list[np.object... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/arraypad.pyi | import sys
from collections.abc import Mapping
from typing import Any, SupportsIndex
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
def mode_func(
ar: npt.NDArray[np.number[Any]],
width: tupl... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/nbit_base_example.pyi | import sys
from typing import TypeVar
import numpy as np
import numpy.typing as npt
from numpy._typing import _64Bit, _32Bit
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
T1 = TypeVar("T1", bound=npt.NBitBase)
T2 = TypeVar("T2", bound=npt.NBitB... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/nested_sequence.pyi | import sys
from collections.abc import Sequence
from typing import Any
from numpy._typing import _NestedSequence
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
a: Sequence[int]
b: Sequence[Sequence[int]]
c: Sequence[Sequence[Sequence[int]]]
d: S... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/false_positives.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_Any: npt.NDArray[Any]
# Mypy bug where overload ambiguity is ignored for `Any`-parametrized types;
# xref numpy/nu... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ndarray_misc.pyi | """
Tests for miscellaneous (non-magic) ``np.ndarray``/``np.generic`` methods.
More extensive tests are performed for the methods'
function-based counterpart in `../from_numeric.py`.
"""
import sys
import operator
import ctypes as ct
from typing import Any, Literal
import numpy as np
import numpy.typing as npt
if ... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/matrix.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
mat: np.matrix[Any, np.dtype[np.int64]]
ar_f8: npt.NDArray[np.float64]
assert_type(mat * 5, np.matrix[Any, Any])
asse... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/modules.pyi | import sys
import types
import numpy as np
from numpy import f2py
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
assert_type(np, types.ModuleType)
assert_type(np.char, types.ModuleType)
assert_type(np.ctypeslib, types.ModuleType)
assert_type(np... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/twodim_base.pyi | import sys
from typing import Any, TypeVar
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
_SCT = TypeVar("_SCT", bound=np.generic)
def func1(ar: npt.NDArray[_SCT], a: int) -> npt.NDArray[_SCT]:
... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/rec.pyi | import io
import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_i8: npt.NDArray[np.int64]
REC_AR_V: np.recarray[Any, np.dtype[np.record]]
AR_LIST: list[npt.NDArray[np.in... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ndarray_conversion.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
nd: npt.NDArray[np.int_]
# item
assert_type(nd.item(), int)
assert_type(nd.item(1), int)
assert_type(nd.item(0, 1), i... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/multiarray.pyi | import sys
import datetime as dt
from typing import Any, TypeVar
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
_SCT = TypeVar("_SCT", bound=np.generic, covariant=True)
class SubClass(npt.NDArray[_S... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/lib_polynomial.pyi | import sys
from typing import Any, NoReturn
from collections.abc import Iterator
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR_b: npt.NDArray[np.bool_]
AR_u4: npt.NDArray[np.uint32]
AR_i8: npt.ND... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/arrayprint.pyi | import sys
import contextlib
from collections.abc import Callable
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy._core.arrayprint import _FormatOptions
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
AR: npt.NDArr... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/dtype.pyi | import sys
import ctypes as ct
from typing import Any
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
dtype_U: np.dtype[np.str_]
dtype_V: np.dtype[np.void]
dtype_i8: np.dtype[np.int64]
assert_type(np.dtype(np.float64), np.dtyp... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/datasource.pyi | import sys
from pathlib import Path
from typing import IO, Any
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
path1: Path
path2: str
d1 = np.lib.npyio.DataSource(path1)
d2 = np.lib.npyio.DataSource(path2)
d3 = np.lib.npyio.Da... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/getlimits.pyi | import sys
from typing import Any
import numpy as np
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
f: float
f8: np.float64
c8: np.complex64
i: int
i8: np.int64
u4: np.uint32
finfo_f8: np.finfo[np.float64]
iinfo_i8: np.iinfo[np.int64]
assert_... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ufuncs.pyi | import sys
from typing import Literal, Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
i8: np.int64
f8: np.float64
AR_f8: npt.NDArray[np.float64]
AR_i8: npt.NDArray[np.int64]
assert_type(np.absol... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/mod.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy._typing import _32Bit, _64Bit
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
f8 = np.float64()
i8 = np.int64()
u8 = np.uint64()
f4 = np.float32()
i4 = np... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/arithmetic.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
from numpy._typing import _32Bit,_64Bit, _128Bit
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
# Can't directly import `np.float128` as it is not available on all p... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/ndarray_shape_manipulation.pyi | import sys
from typing import Any
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_extensions import assert_type
nd: npt.NDArray[np.int64]
# reshape
assert_type(nd.reshape(), npt.NDArray[np.int64])
assert_type(nd.reshape(4), npt.N... | 0 |
public_repos/numpy/numpy/typing/tests/data | public_repos/numpy/numpy/typing/tests/data/reveal/testing.pyi | import re
import sys
import warnings
import types
import unittest
import contextlib
from collections.abc import Callable
from typing import Any, TypeVar
from pathlib import Path
import numpy as np
import numpy.typing as npt
if sys.version_info >= (3, 11):
from typing import assert_type
else:
from typing_exten... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/compat/py3k.py | """
Python 3.X compatibility tools.
While this file was originally intended for Python 2 -> 3 transition,
it is now used to create a compatibility layer between different
minor versions of Python 3.
While the active version of numpy may not support a given version of python, we
allow downstream libraries to continue ... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/compat/__init__.py | """
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
This module is deprecated since 1.26.0 and will be removed in future versions.... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/doc/ufuncs.py | """
===================
Universal Functions
===================
Ufuncs are, generally speaking, mathematical functions or operations that are
applied element-by-element to the contents of an array. That is, the result
in each output array element only depends on the value in the corresponding
input array (or arrays) a... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/__init__.pyi | from numpy.linalg._linalg import (
matrix_power as matrix_power,
solve as solve,
tensorsolve as tensorsolve,
tensorinv as tensorinv,
inv as inv,
cholesky as cholesky,
eigvals as eigvals,
eigvalsh as eigvalsh,
pinv as pinv,
slogdet as slogdet,
det as det,
svd as svd,
e... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/lapack_litemodule.c | /*This module contributed by Doug Heisterkamp
Modified by Jim Hugunin
More modifications by Jeff Whitaker
*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "numpy/arrayobject.h"
#include "npy_cblas.h"
#define FNAME(name) BLAS_FUNC(name)
typedef CBLAS_INT f... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/meson.build | # Note that `python_xerbla.c` was excluded on Windows in setup.py;
# unclear why and it seems needed, so unconditionally used here.
python_xerbla_sources = ['lapack_lite/python_xerbla.c']
lapack_lite_sources = []
if not have_lapack
lapack_lite_sources = [
'lapack_lite/f2c.c',
'lapack_lite/f2c_c_lapack.c',
... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/_linalg.pyi | from collections.abc import Iterable
from typing import (
Literal as L,
overload,
TypeVar,
Any,
SupportsIndex,
SupportsInt,
NamedTuple,
Generic,
)
from numpy import (
generic,
floating,
complexfloating,
int32,
float64,
complex128,
)
from numpy.linalg import LinA... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/_linalg.py | """Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/umath_linalg.cpp | /* -*- c -*- */
/*
*****************************************************************************
** INCLUDES **
*****************************************************************************
*/
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#define NPY_N... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/__init__.py | """
``numpy.linalg``
================
The NumPy linear algebra functions rely on BLAS and LAPACK to provide efficient
low level implementations of standard linear algebra algorithms. Those
libraries may be provided by NumPy itself using C versions of a subset of their
reference implementations but, when possible, high... | 0 |
public_repos/numpy/numpy | public_repos/numpy/numpy/linalg/linalg.py | def __getattr__(attr_name):
import warnings
from numpy.linalg import _linalg
ret = getattr(_linalg, attr_name, None)
if ret is None:
raise AttributeError(
f"module 'numpy.linalg.linalg' has no attribute {attr_name}")
warnings.warn(
"The numpy.linalg.linalg has been made p... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_c_lapack.c.patch | diff --git a/numpy/linalg/lapack_lite/f2c_c_lapack.c b/numpy/linalg/lapack_lite/f2c_c_lapack.c
index a7d1f836b..9e58eec3c 100644
--- a/numpy/linalg/lapack_lite/f2c_c_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_c_lapack.c
@@ -30,8 +30,8 @@ them.
/* Table of constant values */
static integer c__1 = 1;
-static complex... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_lapack.c.patch | diff --git a/numpy/linalg/lapack_lite/f2c_lapack.c b/numpy/linalg/lapack_lite/f2c_lapack.c
index 752261044..47540b37e 100644
--- a/numpy/linalg/lapack_lite/f2c_lapack.c
+++ b/numpy/linalg/lapack_lite/f2c_lapack.c
@@ -183,7 +183,7 @@ integer ieeeck_(integer *ispec, real *zero, real *one)
return ret_val;
} /* ieeec... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/README.rst | Regenerating lapack_lite source
===============================
:Authors: * David M. Cooke <cookedm@physics.mcmaster.ca>
* Eric Wieser (upgraded lapack version on 2017-03-26)
The ``numpy/linalg/f2c_*.c`` files are ``f2c``'d versions of the LAPACK routines
required by the ``LinearAlgebra`` module, and wrappe... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/f2c_z_lapack.f.patch | @@ -15278,5 +15278,6 @@
! Skip any trailing zeros.
DO LASTV = N, I+1, -1
- IF( V( LASTV, I ).NE.ZERO ) EXIT
+ IF( V( LASTV, I ).NE.ZERO ) GO TO 15
END DO
+ 15 CONTINUE
J = MIN( LASTV, PREVLAST... | 0 |
public_repos/numpy/numpy/linalg | public_repos/numpy/numpy/linalg/lapack_lite/clapack_scrub.py | #!/usr/bin/env python2.7
# WARNING! This a Python 2 script. Read README.rst for rationale.
import os
import re
import sys
from plex import Scanner, Str, Lexicon, Opt, Bol, State, AnyChar, TEXT, IGNORE
from plex.traditional import re as Re
try:
from io import BytesIO as UStringIO # Python 2
except ImportError:
... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.