ronantakizawa/codereview-bench huggingface dataset:
Repository: numpy/numpy
File: numpy/lib/tests/test_format.py (Python)

Code before:
    f = BytesIO()
    format.write_array(f, arr)
    f2 = BytesIOSRandomSize(f.getvalue())
    arr2 = format.read_array(f2)
    return arr2


def roundtrip_truncated(arr):
    f = BytesIO()
    format.write_array(f, arr)
    #BytesIO is one byte short
    f2 = BytesIO(f.getvalue()[0:-1])
    arr2 = format.read_array(f2)
    return arr2

def file_truncated(arr):
    with temppath() as path:
        with open(path, 'wb') as f:
            format.write_array(f, arr)
        #truncate the file by one byte
        with open(path, 'rb+') as f:
            f.seek(-1, os.SEEK_END)
            f.truncate()
        with open(path, 'rb') as f:
            arr2 = format.read_array(f)
        return arr2

def assert_equal_(o1, o2):
    assert_(o1 == o2)


def test_roundtrip():
    for arr in basic_arrays + record_arrays:
        arr2 = roundtrip(arr)
        assert_array_equal(arr, arr2)


def test_roundtrip_randsize():
    for arr in basic_arrays + record_arrays:
        if arr.dtype != object:
            arr2 = roundtrip_randsize(arr)
            assert_array_equal(arr, arr2)


def test_roundtrip_truncated():
    for arr in basic_arrays:
        if arr.dtype != object:
            assert_raises(ValueError, roundtrip_truncated, arr)

def test_file_truncated():
    for arr in basic_arrays:

Review comment (refactor):
Please move this into the test.  Also use the `tmppath` fixture (i.e. a "magic" argument that pytest automatically passes if it finds it).

Code after:
    f = BytesIO()
    format.write_array(f, arr)
    f2 = BytesIOSRandomSize(f.getvalue())
    arr2 = format.read_array(f2)
    return arr2


def roundtrip_truncated(arr):
    f = BytesIO()
    format.write_array(f, arr)
    #BytesIO is one byte short
    f2 = BytesIO(f.getvalue()[0:-1])
    arr2 = format.read_array(f2)
    return arr2

def assert_equal_(o1, o2):
    assert_(o1 == o2)


def test_roundtrip():
    for arr in basic_arrays + record_arrays:
        arr2 = roundtrip(arr)
        assert_array_equal(arr, arr2)


def test_roundtrip_randsize():
    for arr in basic_arrays + record_arrays:
        if arr.dtype != object:
            arr2 = roundtrip_randsize(arr)
            assert_array_equal(arr, arr2)


def test_roundtrip_truncated():
    for arr in basic_arrays:
        if arr.dtype != object:
            assert_raises(ValueError, roundtrip_truncated, arr)

def test_file_truncated(tmp_path):
    path = tmp_path / "a.npy"
    for arr in basic_arrays:
        if arr.dtype != object:
            with open(path, 'wb') as f:
                format.write_array(f, arr)
            #truncate the file by one byte
            with open(path, 'rb+') as f:
                f.seek(-1, os.SEEK_END)
                f.truncate()
            with open(path, 'rb') as f:
                with pytest.raises(
                    ValueError, 
                    match = (
Repository: numpy/numpy
File: numpy/_core/src/multiarray/multiarraymodule.c (C)

Code before:
    return NULL;
}

/*NUMPY_API
 * Numeric.matrixproduct(a,v)
 * just like inner product but does the swapaxes stuff on the fly
 */
NPY_NO_EXPORT PyObject *
PyArray_MatrixProduct(PyObject *op1, PyObject *op2)
{
    return PyArray_MatrixProduct2(op1, op2, NULL);
}

static int
check_fperr(const char *func_name)
{
    int errmask = 0;
    if (_get_bufsize_errmask(NULL, &errmask) < 0) {
        return -1;
    }
    if (_check_ufunc_fperr(errmask, func_name) < 0) {
        return -1;
    }

    return 0;
}

/*NUMPY_API
 * Numeric.matrixproduct2(a,v,out)
 * just like inner product but does the swapaxes stuff on the fly
 */
NPY_NO_EXPORT PyObject *
PyArray_MatrixProduct2(PyObject *op1, PyObject *op2, PyArrayObject* out)
{
    PyArrayObject *ap1, *ap2, *out_buf = NULL, *result = NULL;
    PyArrayIterObject *it1, *it2;
    npy_intp i, j, l;
    int typenum, nd, axis, matchDim;
    npy_intp is1, is2, os;
    char *op;
    npy_intp dimensions[NPY_MAXDIMS];
    PyArray_DotFunc *dot;
    PyArray_Descr *typec = NULL;
    NPY_BEGIN_THREADS_DEF;

    typenum = PyArray_ObjectType(op1, NPY_NOTYPE);
    if (typenum == NPY_NOTYPE) {
        return NULL;
    }
    typenum = PyArray_ObjectType(op2, typenum);
    if (typenum == NPY_NOTYPE) {

Review comment (suggestion):
Please use `PyUFunc_GiveFloatingpointErrors`, you can find the rest of the pattern elsewhere (e.g. in scalar math).

Code after:
    return NULL;
}

/*NUMPY_API
 * Numeric.matrixproduct(a,v)
 * just like inner product but does the swapaxes stuff on the fly
 */
NPY_NO_EXPORT PyObject *
PyArray_MatrixProduct(PyObject *op1, PyObject *op2)
{
    return PyArray_MatrixProduct2(op1, op2, NULL);
}

/*NUMPY_API
 * Numeric.matrixproduct2(a,v,out)
 * just like inner product but does the swapaxes stuff on the fly
 */
NPY_NO_EXPORT PyObject *
PyArray_MatrixProduct2(PyObject *op1, PyObject *op2, PyArrayObject* out)
{
    PyArrayObject *ap1, *ap2, *out_buf = NULL, *result = NULL;
    PyArrayIterObject *it1, *it2;
    npy_intp i, j, l;
    int typenum, nd, axis, matchDim;
    npy_intp is1, is2, os;
    char *op;
    npy_intp dimensions[NPY_MAXDIMS];
    PyArray_DotFunc *dot;
    PyArray_Descr *typec = NULL;
    NPY_BEGIN_THREADS_DEF;

    typenum = PyArray_ObjectType(op1, NPY_NOTYPE);
    if (typenum == NPY_NOTYPE) {
        return NULL;
    }
    typenum = PyArray_ObjectType(op2, typenum);
    if (typenum == NPY_NOTYPE) {
        return NULL;
    }

    typec = PyArray_DescrFromType(typenum);
    if (typec == NULL) {
        if (!PyErr_Occurred()) {
            PyErr_SetString(PyExc_TypeError,
                            "Cannot find a common data type.");
        }
        return NULL;
    }

    Py_INCREF(typec);
    ap1 = (PyArrayObject *)PyArray_FromAny(op1, typec, 0, 0,
Repository: numpy/numpy
File: numpy/typing/tests/data/reveal/ma.pyi (Python)

Code before:
import numpy as np
from typing_extensions import assert_type


m: np.ma.MaskedArray[tuple[int], np.dtype[np.float64]]

assert_type(m.shape, tuple[int])

assert_type(m.dtype, np.dtype[np.float64])

assert_type(int(m), int)
assert_type(float(m), float)


Review comment (suggestion):
typing spec (and ruff) doesn't like >1 blank lines in `.pyi`

```suggestion

```

Code after:
import numpy as np
from typing_extensions import assert_type
m: np.ma.MaskedArray[tuple[int], np.dtype[np.float64]]

assert_type(m.shape, tuple[int])

assert_type(m.dtype, np.dtype[np.float64])

assert_type(int(m), int)
assert_type(float(m), float)
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, SupportsIndex, TypeVar, overload, Literal

from _typeshed import Incomplete
from typing_extensions import deprecated

from numpy import _OrderKACF, amax, amin, bool_, dtype, expand_dims, float64, ndarray, generic
from numpy._typing import ArrayLike, _DTypeLikeBool, _ShapeLike, _ArrayLike, _ScalarLike_co

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

Review comment (suggestion):
```suggestion
from typing import Any, Literal, SupportsIndex, TypeVar, overload
```

Code after:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, Literal, SupportsIndex, TypeVar, overload

from _typeshed import Incomplete
from typing_extensions import deprecated

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

__all__ = [
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, SupportsIndex, TypeVar, overload, Literal

from _typeshed import Incomplete
from typing_extensions import deprecated

from numpy import _OrderKACF, amax, amin, bool_, dtype, expand_dims, float64, ndarray, generic
from numpy._typing import ArrayLike, _DTypeLikeBool, _ShapeLike, _ArrayLike, _ScalarLike_co

__all__ = [
    "MAError",
    "MaskError",
    "MaskType",
    "MaskedArray",
    "abs",
    "absolute",
    "add",
    "all",
    "allclose",
    "allequal",
    "alltrue",
    "amax",
    "amin",
    "angle",
    "anom",
    "anomalies",
    "any",
    "append",
    "arange",
    "arccos",
    "arccosh",
    "arcsin",
    "arcsinh",

Review comment (suggestion):
```suggestion
from numpy._typing import ArrayLike, _ArrayLike, _DTypeLikeBool, _ScalarLike_co, _ShapeLike
```

Code after:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, Literal, SupportsIndex, TypeVar, overload

from _typeshed import Incomplete
from typing_extensions import deprecated

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

__all__ = [
    "MAError",
    "MaskError",
    "MaskType",
    "MaskedArray",
    "abs",
    "absolute",
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, SupportsIndex, TypeVar, overload, Literal

from _typeshed import Incomplete
from typing_extensions import deprecated

from numpy import _OrderKACF, amax, amin, bool_, dtype, expand_dims, float64, ndarray, generic
from numpy._typing import ArrayLike, _DTypeLikeBool, _ShapeLike, _ArrayLike, _ScalarLike_co

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

Review comment (suggestion):
```suggestion
from numpy import _OrderKACF, amax, amin, bool_, dtype, expand_dims, float64, generic, ndarray
```

Code after:
# pyright: reportIncompatibleMethodOverride=false
# ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204

from typing import Any, Literal, SupportsIndex, TypeVar, overload

from _typeshed import Incomplete
from typing_extensions import deprecated

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

__all__ = [
    "MAError",
    "MaskError",
    "MaskType",
    "MaskedArray",
    "abs",
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
    fill_value=...,
    keep_mask=...,
    hard_mask=...,
    shrink=...,
    subok=...,
    ndmin=...,
): ...
def is_masked(x): ...

class _extrema_operation(_MaskedUFunc):
    compare: Any
    fill_value_func: Any
    def __init__(self, ufunc, compare, fill_value): ...
    # NOTE: in practice `b` has a default value, but users should
    # explicitly provide a value here as the default is deprecated
    def __call__(self, a, b): ...
    def reduce(self, target, axis=...): ...
    def outer(self, a, b): ...

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: Literal[False] = ...,
) -> _SCT: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> Any: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: _ArrayType = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> _ArrayType: ...

def max(obj, axis=..., out=..., fill_value=..., keepdims=...): ...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...): ...

class _frommethod:
    __name__: Any

Review comment (suggestion):
I realize that this isn't done a lot in numpy at the moment, but it can be helpful to also include the default values in the signatures. See e.g. https://github.com/numpy/numpy/issues/28428 

```suggestion
    axis: None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: Literal[False] | _NoValueType = ...,
```

The `_NoValueType` has yet to be imported from `numpy._globals`. It's an annoying one to type, but I know from numtype that `stubtest` demands that we do.

Code after:
    __itruediv__: Any
    __ipow__: Any
    def copy(self, *args, **kwargs): ...
    def __copy__(self): ...
    def __deepcopy__(self, memo): ...
    def __setattr__(self, attr, value): ...

masked: MaskedConstant
masked_singleton: MaskedConstant
masked_array = MaskedArray

def array(
    data,
    dtype=...,
    copy=...,
    order=...,
    mask=...,
    fill_value=...,
    keep_mask=...,
    hard_mask=...,
    shrink=...,
    subok=...,
    ndmin=...,
): ...
def is_masked(x): ...

class _extrema_operation(_MaskedUFunc):
    compare: Any
    fill_value_func: Any
    def __init__(self, ufunc, compare, fill_value): ...
    # NOTE: in practice `b` has a default value, but users should
    # explicitly provide a value here as the default is deprecated
    def __call__(self, a, b): ...
    def reduce(self, target, axis=...): ...
    def outer(self, a, b): ...

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: Literal[False] | _NoValueType = ...,
) -> _SCT: ...
@overload
def min(
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
class _extrema_operation(_MaskedUFunc):
    compare: Any
    fill_value_func: Any
    def __init__(self, ufunc, compare, fill_value): ...
    # NOTE: in practice `b` has a default value, but users should
    # explicitly provide a value here as the default is deprecated
    def __call__(self, a, b): ...
    def reduce(self, target, axis=...): ...
    def outer(self, a, b): ...

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: Literal[False] = ...,
) -> _SCT: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> Any: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: _ArrayType = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> _ArrayType: ...

def max(obj, axis=..., out=..., fill_value=..., keepdims=...): ...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...): ...

class _frommethod:
    __name__: Any
    __doc__: Any
    reversed: Any
    def __init__(self, methodname, reversed=...): ...
    def getdoc(self): ...
    def __call__(self, a, *args, **params): ...

all: _frommethod
anomalies: _frommethod
anom: _frommethod

Review comment (suggestion):
```suggestion
    axis: _ShapeLike | None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
```

Code after:
masked_array = MaskedArray

def array(
    data,
    dtype=...,
    copy=...,
    order=...,
    mask=...,
    fill_value=...,
    keep_mask=...,
    hard_mask=...,
    shrink=...,
    subok=...,
    ndmin=...,
): ...
def is_masked(x): ...

class _extrema_operation(_MaskedUFunc):
    compare: Any
    fill_value_func: Any
    def __init__(self, ufunc, compare, fill_value): ...
    # NOTE: in practice `b` has a default value, but users should
    # explicitly provide a value here as the default is deprecated
    def __call__(self, a, b): ...
    def reduce(self, target, axis=...): ...
    def outer(self, a, b): ...

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: Literal[False] | _NoValueType = ...,
) -> _SCT: ...
@overload
def min(
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...
) -> Any: ...
@overload
def min(
    obj: ArrayLike,
    axis: None,
    out: _ArrayType,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: Literal[False] = ...,
) -> _SCT: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: None = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> Any: ...

@overload
def min(
    obj: _ArrayLike[Any],
    axis: _ShapeLike | None = ...,
    out: _ArrayType = ...,
    fill_value: _ScalarLike_co | None = ...,
    keepdims: bool = ...,
) -> _ArrayType: ...

def max(obj, axis=..., out=..., fill_value=..., keepdims=...): ...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...): ...

class _frommethod:
    __name__: Any
    __doc__: Any
    reversed: Any
    def __init__(self, methodname, reversed=...): ...
    def getdoc(self): ...
    def __call__(self, a, *args, **params): ...

all: _frommethod
anomalies: _frommethod
anom: _frommethod
any: _frommethod
compress: _frommethod
cumprod: _frommethod
cumsum: _frommethod
copy: _frommethod
diagonal: _frommethod
harden_mask: _frommethod
ids: _frommethod
mean: _frommethod

Review comment (suggestion):
The `...` indicate that `out` is not a required argument here. But the default it is `None`, and `None` cannot be assigned to `_ArrayType`. 

I believe that pyright would report this as a warning in strict mode or something, i.e. it'll spawn one of those evil squiggly lines (sorry for the mental image, but it had to be said; hopefully you'll still be able to sleep tonight).

And in case you haven't seen this trick before, here's a cheeky little hint: 
Keep in mind that `out` can be passed positionally or by keyword.

Code after:
    keep_mask=...,
    hard_mask=...,
    shrink=...,
    subok=...,
    ndmin=...,
): ...
def is_masked(x): ...

class _extrema_operation(_MaskedUFunc):
    compare: Any
    fill_value_func: Any
    def __init__(self, ufunc, compare, fill_value): ...
    # NOTE: in practice `b` has a default value, but users should
    # explicitly provide a value here as the default is deprecated
    def __call__(self, a, b): ...
    def reduce(self, target, axis=...): ...
    def outer(self, a, b): ...

@overload
def min(
    obj: _ArrayLike[_SCT],
    axis: None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: Literal[False] | _NoValueType = ...,
) -> _SCT: ...
@overload
def min(
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...
) -> Any: ...
@overload
def min(
    obj: ArrayLike,
    axis: None,
    out: _ArrayType,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
@overload
def min(
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    *,
    out: _ArrayType,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
Repository: numpy/numpy
File: numpy/ma/core.pyi (Python)

Code before:
def max(obj, axis=..., out=..., fill_value=..., keepdims=...): ...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...): ...

class _frommethod:
    __name__: Any
    __doc__: Any
    reversed: Any
    def __init__(self, methodname, reversed=...): ...
    def getdoc(self): ...
    def __call__(self, a, *args, **params): ...

all: _frommethod
anomalies: _frommethod
anom: _frommethod
any: _frommethod
compress: _frommethod
cumprod: _frommethod
cumsum: _frommethod
copy: _frommethod
diagonal: _frommethod
harden_mask: _frommethod
ids: _frommethod
mean: _frommethod
nonzero: _frommethod
prod: _frommethod
product: _frommethod
ravel: _frommethod
repeat: _frommethod
soften_mask: _frommethod
std: _frommethod
sum: _frommethod
swapaxes: _frommethod
trace: _frommethod
var: _frommethod
count: _frommethod
argmin: _frommethod
argmax: _frommethod

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, axis=..., kind=..., order=..., endwith=..., fill_value=..., *, stable=...): ...
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=...): ...

Review comment (refactor):
`max` and `ptp` have identical signatures, so if you're not too attached to being DRY, then some good old fashioned auto-plagiarism (a.k.a. ctrl+c ctrl+v) might be an easy way to triple your winnings.

Code after:
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    out: None = None,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...
) -> Any: ...
@overload
def min(
    obj: ArrayLike,
    axis: None,
    out: _ArrayType,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...
@overload
def min(
    obj: ArrayLike,
    axis: _ShapeLike | None = None,
    *,
    out: _ArrayType,
    fill_value: _ScalarLike_co | None = None,
    keepdims: bool | _NoValueType = ...,
) -> _ArrayType: ...

def max(obj, axis=..., out=..., fill_value=..., keepdims=...): ...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...): ...

class _frommethod:
    __name__: Any
    __doc__: Any
    reversed: Any
    def __init__(self, methodname, reversed=...): ...
    def getdoc(self): ...
    def __call__(self, a, *args, **params): ...

all: _frommethod
anomalies: _frommethod
anom: _frommethod
any: _frommethod
compress: _frommethod
cumprod: _frommethod
cumsum: _frommethod
copy: _frommethod
diagonal: _frommethod
harden_mask: _frommethod
ids: _frommethod
mean: _frommethod
nonzero: _frommethod
prod: _frommethod
product: _frommethod
ravel: _frommethod