1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
| from typing import Any, TypeVar, assert_type
|
| import numpy as np
| import numpy.typing as npt
|
| _ScalarT = TypeVar("_ScalarT", bound=np.generic)
|
| def func1(ar: npt.NDArray[_ScalarT], a: int) -> npt.NDArray[_ScalarT]: ...
|
| def func2(ar: npt.NDArray[np.number], a: str) -> npt.NDArray[np.float64]: ...
|
| AR_b: npt.NDArray[np.bool]
| AR_u: npt.NDArray[np.uint64]
| AR_i: npt.NDArray[np.int64]
| AR_f: npt.NDArray[np.float64]
| AR_c: npt.NDArray[np.complex128]
| AR_O: npt.NDArray[np.object_]
|
| AR_LIKE_b: list[bool]
| AR_LIKE_c: list[complex]
|
| assert_type(np.fliplr(AR_b), npt.NDArray[np.bool])
| assert_type(np.fliplr(AR_LIKE_b), npt.NDArray[Any])
|
| assert_type(np.flipud(AR_b), npt.NDArray[np.bool])
| assert_type(np.flipud(AR_LIKE_b), npt.NDArray[Any])
|
| assert_type(np.eye(10), npt.NDArray[np.float64])
| assert_type(np.eye(10, M=20, dtype=np.int64), npt.NDArray[np.int64])
| assert_type(np.eye(10, k=2, dtype=int), npt.NDArray[Any])
|
| assert_type(np.diag(AR_b), npt.NDArray[np.bool])
| assert_type(np.diag(AR_LIKE_b, k=0), npt.NDArray[Any])
|
| assert_type(np.diagflat(AR_b), npt.NDArray[np.bool])
| assert_type(np.diagflat(AR_LIKE_b, k=0), npt.NDArray[Any])
|
| assert_type(np.tri(10), npt.NDArray[np.float64])
| assert_type(np.tri(10, M=20, dtype=np.int64), npt.NDArray[np.int64])
| assert_type(np.tri(10, k=2, dtype=int), npt.NDArray[Any])
|
| assert_type(np.tril(AR_b), npt.NDArray[np.bool])
| assert_type(np.tril(AR_LIKE_b, k=0), npt.NDArray[Any])
|
| assert_type(np.triu(AR_b), npt.NDArray[np.bool])
| assert_type(np.triu(AR_LIKE_b, k=0), npt.NDArray[Any])
|
| assert_type(np.vander(AR_b), npt.NDArray[np.signedinteger])
| assert_type(np.vander(AR_u), npt.NDArray[np.signedinteger])
| assert_type(np.vander(AR_i, N=2), npt.NDArray[np.signedinteger])
| assert_type(np.vander(AR_f, increasing=True), npt.NDArray[np.floating])
| assert_type(np.vander(AR_c), npt.NDArray[np.complexfloating])
| assert_type(np.vander(AR_O), npt.NDArray[np.object_])
|
| assert_type(
| np.histogram2d(AR_LIKE_c, AR_LIKE_c),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.complex128 | np.float64],
| npt.NDArray[np.complex128 | np.float64],
| ],
| )
| assert_type(
| np.histogram2d(AR_i, AR_b),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| ],
| )
| assert_type(
| np.histogram2d(AR_f, AR_i),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| ],
| )
| assert_type(
| np.histogram2d(AR_i, AR_f),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| npt.NDArray[np.float64],
| ],
| )
| assert_type(
| np.histogram2d(AR_f, AR_c, weights=AR_LIKE_b),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.complex128],
| npt.NDArray[np.complex128],
| ],
| )
| assert_type(
| np.histogram2d(AR_f, AR_c, bins=8),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.complex128],
| npt.NDArray[np.complex128],
| ],
| )
| assert_type(
| np.histogram2d(AR_c, AR_f, bins=(8, 5)),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.complex128],
| npt.NDArray[np.complex128],
| ],
| )
| assert_type(
| np.histogram2d(AR_c, AR_i, bins=AR_u),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.uint64],
| npt.NDArray[np.uint64],
| ],
| )
| assert_type(
| np.histogram2d(AR_c, AR_c, bins=(AR_u, AR_u)),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.uint64],
| npt.NDArray[np.uint64],
| ],
| )
| assert_type(
| np.histogram2d(AR_c, AR_c, bins=(AR_b, 8)),
| tuple[
| npt.NDArray[np.float64],
| npt.NDArray[np.bool | np.complex128],
| npt.NDArray[np.bool | np.complex128],
| ],
| )
|
| assert_type(np.mask_indices(10, func1), tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]])
| assert_type(np.mask_indices(8, func2, "0"), tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]])
|
| assert_type(np.tril_indices(10), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]])
|
| assert_type(np.tril_indices_from(AR_b), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]])
|
| assert_type(np.triu_indices(10), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]])
|
| assert_type(np.triu_indices_from(AR_b), tuple[npt.NDArray[np.int_], npt.NDArray[np.int_]])
|
|