from typing import Any, TypeVar

T = TypeVar("T")

class dtype:
    float32: dtype
    float64: dtype
    int32: dtype
    int64: dtype
    bool: dtype

class ndarray[T]:
    dtype: dtype
    shape: tuple[int, ...]
    ndim: int
    size: int

    def __init__(self, shape: tuple[int, ...], dtype: dtype = None) -> None: ...
    def __getitem__(self, key: Any) -> ndarray[T]: ...
    def __setitem__(self, key: Any, value: Any) -> None: ...
    def reshape(self, *shape: int) -> ndarray[T]: ...
    def flatten(self) -> ndarray[T]: ...

def array(object: Any, dtype: dtype = None) -> ndarray[Any]: ...
def zeros(shape: tuple[int, ...], dtype: dtype = None) -> ndarray[Any]: ...
def ones(shape: tuple[int, ...], dtype: dtype = None) -> ndarray[Any]: ...
def empty(shape: tuple[int, ...], dtype: dtype = None) -> ndarray[Any]: ...
