ronantakizawa/codereview-bench huggingface dataset:
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
    *,
    out: _ArrayType,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
@overload
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None,
    fill_value: _ScalarLike_co | None,
    out: _ArrayType,
    *,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...

minimum: _extrema_operation
maximum: _extrema_operation

def take(a, indices, axis=..., out=..., mode=...): ...
def power(a, b, third=...): ...
def argsort(a, axis=..., kind=..., order=..., endwith=..., fill_value=..., *, stable=...): ...
def sort(
    a: _MaskedArrayType,
    axis: SupportsIndex | None = None,
    kind: _SortKind | None = None,
    order: str | Sequence[str] | None = None,
    endwith: bool | None = None,
    fill_value: _ScalarLike_co | None = None,
    *,
    stable: bool | None = None,
) -> _MaskedArrayType: ...
def compressed(x): ...
def concatenate(arrays, axis=...): ...
def diag(v, k=...): ...
def left_shift(a, n): ...
def right_shift(a, n): ...
def put(a, indices, values, mode=...): ...
def putmask(a, mask, values): ...
def transpose(a, axes=...): ...
def reshape(a, new_shape, order=...): ...
def resize(x, new_shape): ...
def ndim(obj): ...
def shape(obj): ...
def size(obj, axis=...): ...
def diff(a, /, n=..., axis=..., prepend=..., append=...): ...
def where(condition, x=..., y=...): ...
def choose(indices, choices, out=..., mode=...): ...
def round_(a, decimals=..., out=...): ...
round = round_

def inner(a, b): ...
innerproduct = inner

Review comment (suggestion):
```suggestion
    axis: SupportsIndex | None = -1,
    kind: _SortKind | None = None,
    order: str | Sequence[str] | None = None,
    endwith: bool | None = True,
```

Code after:
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None = None,
    fill_value: _ScalarLike_co | None = None,
    *,
    out: _ArrayType,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
@overload
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None,
    fill_value: _ScalarLike_co | None,
    out: _ArrayType,
    *,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...

minimum: _extrema_operation
maximum: _extrema_operation

def take(a, indices, axis=..., out=..., mode=...): ...
def power(a, b, third=...): ...
def argsort(a, axis=..., kind=..., order=..., endwith=..., fill_value=..., *, stable=...): ...
@overload
def sort(
    a: _ArrayType,
    axis: SupportsIndex = -1,
    kind: _SortKind | None = None,
    order: str | Sequence[str] | None = None,
    endwith: bool | None = True,
    fill_value: _ScalarLike_co | None = None,
    *,
    stable: Literal[False] | None = False,
) -> _ArrayType: ...
@overload
def sort(
    a: ArrayLike,
    axis: SupportsIndex = -1,
    kind: _SortKind | None = None,
    order: str | Sequence[str] | None = None,
    endwith: bool | None = True,
    fill_value: _ScalarLike_co | None = None,
    *,
    stable: Literal[False] | None = False,
) -> NDArray[Any]: ...
def compressed(x): ...
def concatenate(arrays, axis=...): ...
def diag(v, k=...): ...
def left_shift(a, n): ...
def right_shift(a, n): ...
Repository: numpy/numpy
File: numpy/typing/tests/data/fail/ma.pyi (Python)

Code before:
m.ptp(out=1.0)  # E: No overload variant
m.ptp(fill_value=lambda x: 27)  # E: No overload variant

m.argmin(axis=1.0)  # E: No overload variant
m.argmin(keepdims=1.0)  # E: No overload variant
m.argmin(out=1.0)  # E: No overload variant
m.argmin(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmin(m, axis=1.0)  # E: No overload variant
np.ma.argmin(m, axis=(1,))  # E: No overload variant
np.ma.argmin(m, keepdims=1.0)  # E: No overload variant
np.ma.argmin(m, out=1.0)  # E: No overload variant
np.ma.argmin(m, fill_value=lambda x: 27)  # E: No overload variant

m.argmax(axis=1.0)  # E: No overload variant
m.argmax(keepdims=1.0)  # E: No overload variant
m.argmax(out=1.0)  # E: No overload variant
m.argmax(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmax(m, axis=1.0)  # E: No overload variant
np.ma.argmax(m, axis=(0,))  # E: No overload variant
np.ma.argmax(m, keepdims=1.0)  # E: No overload variant
np.ma.argmax(m, out=1.0)  # E: No overload variant
np.ma.argmax(m, fill_value=lambda x: 27)  # E: No overload variant

m.sort(axis=(0,1))  # E: No overload variant
m.sort(kind='cabbage')  # E: No overload variant
m.sort(order=lambda: 'cabbage')  # E: No overload variant
m.sort(endwith='cabbage')  # E: No overload variant
m.sort(fill_value=lambda: 'cabbage')  # E: No overload variant
m.sort(stable='cabbage')  # E: No overload variant


Review comment (suggestion):
```suggestion
m.sort(axis=(0,1))  # E: No overload variant
m.sort(axis=None)  # E: No overload variant
```

Code after:
m.ptp(out=1.0)  # E: No overload variant
m.ptp(fill_value=lambda x: 27)  # E: No overload variant

m.argmin(axis=1.0)  # E: No overload variant
m.argmin(keepdims=1.0)  # E: No overload variant
m.argmin(out=1.0)  # E: No overload variant
m.argmin(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmin(m, axis=1.0)  # E: No overload variant
np.ma.argmin(m, axis=(1,))  # E: No overload variant
np.ma.argmin(m, keepdims=1.0)  # E: No overload variant
np.ma.argmin(m, out=1.0)  # E: No overload variant
np.ma.argmin(m, fill_value=lambda x: 27)  # E: No overload variant

m.argmax(axis=1.0)  # E: No overload variant
m.argmax(keepdims=1.0)  # E: No overload variant
m.argmax(out=1.0)  # E: No overload variant
m.argmax(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmax(m, axis=1.0)  # E: No overload variant
np.ma.argmax(m, axis=(0,))  # E: No overload variant
np.ma.argmax(m, keepdims=1.0)  # E: No overload variant
np.ma.argmax(m, out=1.0)  # E: No overload variant
np.ma.argmax(m, fill_value=lambda x: 27)  # E: No overload variant

m.sort(axis=(0,1))  # E: No overload variant
m.sort(axis=None)  # E: No overload variant
m.sort(kind='cabbage')  # E: No overload variant
m.sort(order=lambda: 'cabbage')  # E: No overload variant
m.sort(endwith='cabbage')  # E: No overload variant
m.sort(fill_value=lambda: 'cabbage')  # E: No overload variant
m.sort(stable='cabbage')  # E: No overload variant
m.sort(stable=True)  # E: No overload variant
Repository: numpy/numpy
File: numpy/typing/tests/data/fail/ma.pyi (Python)

Code before:
m.argmin(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmin(m, axis=1.0)  # E: No overload variant
np.ma.argmin(m, axis=(1,))  # E: No overload variant
np.ma.argmin(m, keepdims=1.0)  # E: No overload variant
np.ma.argmin(m, out=1.0)  # E: No overload variant
np.ma.argmin(m, fill_value=lambda x: 27)  # E: No overload variant

m.argmax(axis=1.0)  # E: No overload variant
m.argmax(keepdims=1.0)  # E: No overload variant
m.argmax(out=1.0)  # E: No overload variant
m.argmax(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmax(m, axis=1.0)  # E: No overload variant
np.ma.argmax(m, axis=(0,))  # E: No overload variant
np.ma.argmax(m, keepdims=1.0)  # E: No overload variant
np.ma.argmax(m, out=1.0)  # E: No overload variant
np.ma.argmax(m, fill_value=lambda x: 27)  # E: No overload variant

m.sort(axis=(0,1))  # E: No overload variant
m.sort(kind='cabbage')  # E: No overload variant
m.sort(order=lambda: 'cabbage')  # E: No overload variant
m.sort(endwith='cabbage')  # E: No overload variant
m.sort(fill_value=lambda: 'cabbage')  # E: No overload variant
m.sort(stable='cabbage')  # E: No overload variant


Review comment (suggestion):
```suggestion
m.sort(stable='cabbage')  # E: No overload variant
m.sort(stable=True)  # E: No overload variant
```

Code after:
m.argmin(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmin(m, axis=1.0)  # E: No overload variant
np.ma.argmin(m, axis=(1,))  # E: No overload variant
np.ma.argmin(m, keepdims=1.0)  # E: No overload variant
np.ma.argmin(m, out=1.0)  # E: No overload variant
np.ma.argmin(m, fill_value=lambda x: 27)  # E: No overload variant

m.argmax(axis=1.0)  # E: No overload variant
m.argmax(keepdims=1.0)  # E: No overload variant
m.argmax(out=1.0)  # E: No overload variant
m.argmax(fill_value=lambda x: 27)  # E: No overload variant

np.ma.argmax(m, axis=1.0)  # E: No overload variant
np.ma.argmax(m, axis=(0,))  # E: No overload variant
np.ma.argmax(m, keepdims=1.0)  # E: No overload variant
np.ma.argmax(m, out=1.0)  # E: No overload variant
np.ma.argmax(m, fill_value=lambda x: 27)  # E: No overload variant

m.sort(axis=(0,1))  # E: No overload variant
m.sort(axis=None)  # E: No overload variant
m.sort(kind='cabbage')  # E: No overload variant
m.sort(order=lambda: 'cabbage')  # E: No overload variant
m.sort(endwith='cabbage')  # E: No overload variant
m.sort(fill_value=lambda: 'cabbage')  # E: No overload variant
m.sort(stable='cabbage')  # E: No overload variant
m.sort(stable=True)  # E: No overload variant
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:

from collections.abc import Sequence
from typing import Any, Literal, SupportsIndex, TypeAlias, TypeVar, overload

from _typeshed import Incomplete
from typing_extensions import deprecated

from numpy import (
    _OrderKACF,
    _PartitionKind,
    _SortKind,
    amax,
    amin,
    bool_,
    dtype,
    expand_dims,
    float64,
    generic,
    intp,
    ndarray,
)
from numpy._globals import _NoValueType
from numpy._typing import (
    ArrayLike,
    NDArray,
    _ArrayLikeInt_co,
    _ArrayLike,
    _DTypeLikeBool,
    _ScalarLike_co,
    _Shape,
    _ShapeLike,
)

__all__ = [
    "MAError",
    "MaskError",
    "MaskType",
    "MaskedArray",
    "abs",
    "absolute",
    "add",
    "all",
    "allclose",
    "allequal",
    "alltrue",
    "amax",
    "amin",
    "angle",
    "anom",
    "anomalies",
    "any",

Review comment (suggestion):
Since passing booleans for `kth` is deprecated, it might be a bit cleaner to use `_ArrayLikeInt`

Code after:

from collections.abc import Sequence
from typing import Any, Literal, SupportsIndex, TypeAlias, TypeVar, overload

from _typeshed import Incomplete
from typing_extensions import deprecated

from numpy import (
    _OrderKACF,
    _PartitionKind,
    _SortKind,
    amax,
    amin,
    bool_,
    dtype,
    expand_dims,
    float64,
    generic,
    intp,
    ndarray,
)
from numpy._globals import _NoValueType
from numpy._typing import (
    ArrayLike,
    NDArray,
    _ArrayLike,
    _DTypeLikeBool,
    _ArrayLikeInt,
    _ScalarLike_co,
    _Shape,
    _ShapeLike,
)

__all__ = [
    "MAError",
    "MaskError",
    "MaskType",
    "MaskedArray",
    "abs",
    "absolute",
    "add",
    "all",
    "allclose",
    "allequal",
    "alltrue",
    "amax",
    "amin",
    "angle",
    "anom",
    "anomalies",
    "any",
Repository: numpy/numpy
File: numpy/_core/src/multiarray/getset.c (C)

Code before:

    while(selfit->index < selfit->size) {
        copyswap(selfit->dataptr, arrit->dataptr, swap, self);
        PyArray_ITER_NEXT(selfit);
        PyArray_ITER_NEXT(arrit);
        if (arrit->index == arrit->size) {
            PyArray_ITER_RESET(arrit);
        }
    }
    retval = 0;

 exit:
    Py_XDECREF(selfit);
    Py_XDECREF(arrit);
    Py_XDECREF(arr);
    return retval;
}

static PyObject *
array_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    int ndim = PyArray_NDIM(self);
    if (ndim != 2) {
        if (PyErr_WarnFormat(PyExc_UserWarning, 1,
                "In the future `.T` property will be supported for "
                "2-dim arrays only. Here it is %d-dim array.",
                ndim) < 0) {
            return NULL;
        }
    }
    return PyArray_Transpose(self, NULL);
}

static PyObject *
array_matrix_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    return PyArray_MatrixTranspose(self);
}

static PyObject *
array_ptp(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    PyErr_SetString(PyExc_AttributeError,
                    "`ptp` was removed from the ndarray class in NumPy 2.0. "
                    "Use np.ptp(arr, ...) instead.");
    return NULL;
}

static PyObject *
array_newbyteorder(PyArrayObject *self, PyObject *args)
{

Review comment (suggestion):
```suggestion
                "2-dim arrays only. Received %d-dim array.",
```

This should also suggest how to fix code triggering the warning

Code after:

    while(selfit->index < selfit->size) {
        copyswap(selfit->dataptr, arrit->dataptr, swap, self);
        PyArray_ITER_NEXT(selfit);
        PyArray_ITER_NEXT(arrit);
        if (arrit->index == arrit->size) {
            PyArray_ITER_RESET(arrit);
        }
    }
    retval = 0;

 exit:
    Py_XDECREF(selfit);
    Py_XDECREF(arrit);
    Py_XDECREF(arr);
    return retval;
}

static PyObject *
array_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    int ndim = PyArray_NDIM(self);
    if (ndim != 2) {
        /* Deprecated 2025-04-19, NumPy 2.3 */
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "In the future, the `.T` property will be supported for "
                "2-dimensional arrays only. Received %d-dimensional "
                "array. Either `arr.transpose()` or `.mT` (which swaps "
                "the last two axes only) should be used instead."
                "(Deprecated NumPy 2.3)", ndim) < 0) {
            return NULL;
        }
    }
    return PyArray_Transpose(self, NULL);
}

static PyObject *
array_matrix_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    return PyArray_MatrixTranspose(self);
}

static PyObject *
array_ptp(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    PyErr_SetString(PyExc_AttributeError,
                    "`ptp` was removed from the ndarray class in NumPy 2.0. "
                    "Use np.ptp(arr, ...) instead.");
    return NULL;
}
Repository: numpy/numpy
File: numpy/_core/tests/test_deprecations.py (Python)

Code before:
            self.assert_deprecated(np.save, args=sample_args,
                                kwargs={'fix_imports': False})
            for allow_pickle in [True, False]:
                self.assert_not_deprecated(np.save, args=sample_args,
                                        kwargs={'allow_pickle': allow_pickle})
                self.assert_deprecated(np.save, args=sample_args,
                                    kwargs={'allow_pickle': allow_pickle,
                                            'fix_imports': True})
                self.assert_deprecated(np.save, args=sample_args,
                                    kwargs={'allow_pickle': allow_pickle,
                                            'fix_imports': False})


class TestAddNewdocUFunc(_DeprecationTestCase):
    # Deprecated in Numpy 2.2, 2024-11
    def test_deprecated(self):
        self.assert_deprecated(
            lambda: np._core.umath._add_newdoc_ufunc(
                struct_ufunc.add_triplet, "new docs"
            )
        )


def test_deprecated_T_non_2dim():
    # Deprecated in Numpy 2.3, 2025-04
    with pytest.warns(UserWarning, match="In the future `.T` property for "
                      "array scalars will raise an error."):
        np.int64(1).T
    for shape in [(5,), (2, 3, 4)]:
        with pytest.warns(
                UserWarning,
                match="In the future `.T` property will be "
                      "supported for 2-dim arrays only. "
                      f"Received {len(shape)}-dim array."):
            np.ones(shape).T


Review comment (suggestion):
Please use `assert_deprecated` as all other tests in this file.  That ensures that the error path is also tested, even if that is rather trivial here.

Code after:
                self.assert_deprecated(np.save, args=sample_args,
                                    kwargs={'allow_pickle': allow_pickle,
                                            'fix_imports': False})


class TestAddNewdocUFunc(_DeprecationTestCase):
    # Deprecated in Numpy 2.2, 2024-11
    def test_deprecated(self):
        self.assert_deprecated(
            lambda: np._core.umath._add_newdoc_ufunc(
                struct_ufunc.add_triplet, "new docs"
            )
        )


class TestDeprecatedTPropScalar(_DeprecationTestCase):
    # Deprecated in Numpy 2.3, 2025-05
    message = ("In the future, the `.T` property for array scalars will "
               "raise an error.")

    def test_deprecated(self):
        self.assert_deprecated(lambda: np.int64(1).T)


class TestDeprecatedTPropNon2Dim(_DeprecationTestCase):
    # Deprecated in Numpy 2.3, 2025-05
    message = ("In the future, the `.T` property will be supported for "
               r"2-dimensional arrays only. Received \d+-dimensional array.")

    def test_deprecated(self):
        for shape in [(5,), (2, 3, 4)]:
            self.assert_deprecated(lambda: np.ones(shape).T)
Repository: numpy/numpy
File: numpy/_core/src/multiarray/getset.c (C)

Code before:
        PyArray_ITER_NEXT(selfit);
        PyArray_ITER_NEXT(arrit);
        if (arrit->index == arrit->size) {
            PyArray_ITER_RESET(arrit);
        }
    }
    retval = 0;

 exit:
    Py_XDECREF(selfit);
    Py_XDECREF(arrit);
    Py_XDECREF(arr);
    return retval;
}

static PyObject *
array_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    int ndim = PyArray_NDIM(self);
    if (ndim != 2) {
        if (PyErr_WarnFormat(PyExc_UserWarning, 1,
                "In the future `.T` property will be supported for "
                "2-dim arrays only. Received %d-dim array. Either "
                "`np.permute_dims(arr, range(arr.ndim)[::-1])` "
                "(compatible with the Array API) or `arr.transpose()` "
                "should be used instead.",
                ndim) < 0) {
            return NULL;
        }
    }
    return PyArray_Transpose(self, NULL);
}

static PyObject *
array_matrix_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    return PyArray_MatrixTranspose(self);
}

static PyObject *
array_ptp(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    PyErr_SetString(PyExc_AttributeError,
                    "`ptp` was removed from the ndarray class in NumPy 2.0. "
                    "Use np.ptp(arr, ...) instead.");
    return NULL;
}

static PyObject *
array_newbyteorder(PyArrayObject *self, PyObject *args)
{

Review comment (suggestion):
Add `(Deprecated NumPy 2....)` as all our deprecation warnings should have.

Code after:
        PyArray_ITER_NEXT(selfit);
        PyArray_ITER_NEXT(arrit);
        if (arrit->index == arrit->size) {
            PyArray_ITER_RESET(arrit);
        }
    }
    retval = 0;

 exit:
    Py_XDECREF(selfit);
    Py_XDECREF(arrit);
    Py_XDECREF(arr);
    return retval;
}

static PyObject *
array_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    int ndim = PyArray_NDIM(self);
    if (ndim != 2) {
        /* Deprecated 2025-04-19, NumPy 2.3 */
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "In the future, the `.T` property will be supported for "
                "2-dimensional arrays only. Received %d-dimensional "
                "array. Either `arr.transpose()` or `.mT` (which swaps "
                "the last two axes only) should be used instead."
                "(Deprecated NumPy 2.3)", ndim) < 0) {
            return NULL;
        }
    }
    return PyArray_Transpose(self, NULL);
}

static PyObject *
array_matrix_transpose_get(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    return PyArray_MatrixTranspose(self);
}

static PyObject *
array_ptp(PyArrayObject *self, void *NPY_UNUSED(ignored))
{
    PyErr_SetString(PyExc_AttributeError,
                    "`ptp` was removed from the ndarray class in NumPy 2.0. "
                    "Use np.ptp(arr, ...) instead.");
    return NULL;
}

static PyObject *
array_newbyteorder(PyArrayObject *self, PyObject *args)
{
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
) -> Any: ...
@overload
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None = None,
    fill_value: _ScalarLike_co | None = None,
    *,
    out: _ArrayT,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayT: ...
@overload
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None,
    fill_value: _ScalarLike_co | None,
    out: _ArrayT,
    *,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayT: ...

minimum: _extrema_operation
maximum: _extrema_operation

@overload
def take(  # type: ignore[overload-overlap]
    a: _MaskedArray[_SCT],
    indices: _IntLike_co,
    axis: None = None,
    out: None = None,
    mode: _ModeKind = 'raise'
) -> _SCT: ...
@overload
def take(
    a: ArrayLike,
    indices: _IntLike_co,
    axis: SupportsIndex | None = None,
    out: None = None,
    mode: _ModeKind = 'raise',
) -> Any: ...
@overload
def take(
    a: _MaskedArray[_SCT],
    indices: _ArrayLikeInt_co,
    axis: SupportsIndex | None = None,
    out: None = None,
    mode: _ModeKind = 'raise',
) -> _MaskedArray[_SCT]: ...
@overload
def take(
    a: ArrayLike,
    indices: _ArrayLikeInt_co,

Review comment (suggestion):
```pycon
>>> import numpy as np
>>> np.ma.take([[1,2], [3,4]], 1)
np.int64(2)
```

so we can broaden `a`:

```suggestion
    a: _ArrayLike[_SCT],
```

Code after:
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None = None,
    fill_value: _ScalarLike_co | None = None,
    *,
    out: _ArrayT,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayT: ...
@overload
def argmax(
    self: ArrayLike,
    axis: SupportsIndex | None,
    fill_value: _ScalarLike_co | None,
    out: _ArrayT,
    *,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayT: ...

minimum: _extrema_operation
maximum: _extrema_operation

@overload
def take(  # type: ignore[overload-overlap]
    a: _ArrayLike[_SCT],
    indices: _IntLike_co,
    axis: None = None,
    out: None = None,
    mode: _ModeKind = 'raise'
) -> _SCT: ...
@overload
def take(
    a: _ArrayLike[_SCT],
    indices: _ArrayLikeInt_co,
    axis: SupportsIndex | None = None,
    out: None = None,
    mode: _ModeKind = 'raise',
) -> _MaskedArray[_SCT]: ...
@overload
def take(
    a: ArrayLike,
    indices: _IntLike_co,
    axis: SupportsIndex | None = None,
    out: None = None,
    mode: _ModeKind = 'raise',
) -> Any: ...
@overload
def take(
    a: ArrayLike,
    indices: _ArrayLikeInt_co,
    axis: SupportsIndex | None = None,
    out: None = None,