files: """
  Wrapper class around the ndarray object for the array API standard.
  
  The array API standard defines some behaviors differently than ndarray, in
  particular, type promotion rules are different (the standard has no
  value-based casting). The standard also specifies a more limited subset of
  array methods and functionalities than are implemented on ndarray. Since the
  goal of the array_api namespace is to be a minimal implementation of the array
  API standard, we need to define a separate wrapper class for the array_api
  namespace.
  
  The standard compliant class is only a wrapper class. It is *not* a subclass
  of ndarray.
  """
  
  from __future__ import annotations
  
  import operator
  from enum import IntEnum
  from ._creation_functions import asarray
  from ._dtypes import _boolean_dtypes, _integer_dtypes, _floating_dtypes
  
  from typing import TYPE_CHECKING
  if TYPE_CHECKING:
      from ._types import Any, Optional, PyCapsule, Tuple, Union, Device, Dtype
  
  import numpy as np
  
  class Array:
      """
      n-d array object for the array API namespace.
  
      See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
      information.
  
      This is a wrapper around numpy.ndarray that restricts the usage to only
      those things that are required by the array API namespace. Note,
      attributes on this object that start with a single underscore are not part
      of the API specification and should only be used internally. This object
      should not be constructed directly. Rather, use one of the creation
      functions, such as asarray().
  
      """
      # Use a custom constructor instead of __init__, as manually initializing
      # this class is not supported API.
      @classmethod
      def _new(cls, x, /):
          """
          This is a private method for initializing the array API Array
          object.
  
          Functions outside of the array_api submodule should not use this
          method. Use one of the creation functions instead, such as
          ``asarray``.
  
          """
          obj = super().__new__(cls)
          # Note: The spec does not have array scalars, only shape () arrays.
          if isinstance(x, np.generic):
              # Convert the array scalar to a shape () array
              xa = np.empty((), x.dtype)
              xa[()] = x
              x = xa
          obj._array = x
          return obj
  
      # Prevent Array() from working
      def __new__(cls, *args, **kwargs):
          raise TypeError("The array_api Array object should not be instantiated directly. Use an array creation function, such as asarray(), instead.")
  
      # These functions are not required by the spec, but are implemented for
      # the sake of usability.
  
      def __str__(self: Array, /) -> str:
          """
          Performs the operation __str__.
          """
          return self._array.__str__().replace('array', 'Array')
  
      def __repr__(self: Array, /) -> str:
          """
          Performs the operation __repr__.
          """
          return self._array.__repr__().replace('array', 'Array')
  
      # Helper function to match the type promotion rules in the spec
      def _promote_scalar(self, scalar):
          """
          Returns a promoted version of a Python scalar appropriate for use with
          operations on self.
  
          This may raise an OverflowError in cases where the scalar is an
          integer that is too large to fit in a NumPy integer dtype, or
          TypeError when the scalar type is incompatible with the dtype of self.
          """
          if isinstance(scalar, bool):
              if self.dtype not in _boolean_dtypes:
                  raise TypeError("Python bool scalars can only be promoted with bool arrays")
          elif isinstance(scalar, int):
              if self.dtype in _boolean_dtypes:
                  raise TypeError("Python int scalars cannot be promoted with bool arrays")
          elif isinstance(scalar, float):
              if self.dtype not in _floating_dtypes:
                  raise TypeError("Python float scalars can only be promoted with floating-point arrays.")
          else:
              raise TypeError("'scalar' must be a Python scalar")
  
          # Note: the spec only specifies integer-dtype/int promotion
          # behavior for integers within the bounds of the integer dtype.
          # Outside of those bounds we use the default NumPy behavior (either
          # cast or raise OverflowError).
          return Array._new(np.array(scalar, self.dtype))
  
      @staticmethod
      def _normalize_two_args(x1, x2):
          """
          Normalize inputs to two arg functions to fix type promotion
  
  [... the rest is omitted ...]
files: numpy/_array_api/_array_object.py
files: """
  Wrapper class around the ndarray object for the array API standard.
  
  The array API standard defines some behaviors differently than ndarray, in
  particular, type promotion rules are different (the standard has no
  value-based casting). The standard also specifies a more limited subset of
  array methods and functionalities than are implemented on ndarray. Since the
  goal of the array_api namespace is to be a minimal implementation of the array
  API standard, we need to define a separate wrapper class for the array_api
  namespace.
  
  The standard compliant class is only a wrapper class. It is *not* a subclass
  of ndarray.
  """
  
  from __future__ import annotations
  
  import operator
  from enum import IntEnum
  from ._creation_functions import asarray
  from ._dtypes import _boolean_dtypes, _integer_dtypes, _floating_dtypes
  
  from typing import TYPE_CHECKING
  if TYPE_CHECKING:
      from ._types import Any, Optional, PyCapsule, Tuple, Union, Device, Dtype
  
  import numpy as np
  
  class Array:
      """
      n-d array object for the array API namespace.
  
      See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
      information.
  
      This is a wrapper around numpy.ndarray that restricts the usage to only
      those things that are required by the array API namespace. Note,
      attributes on this object that start with a single underscore are not part
      of the API specification and should only be used internally. This object
      should not be constructed directly. Rather, use one of the creation
      functions, such as asarray().
  
      """
      # Use a custom constructor instead of __init__, as manually initializing
      # this class is not supported API.
      @classmethod
      def _new(cls, x, /):
          """
          This is a private method for initializing the array API Array
          object.
  
          Functions outside of the array_api submodule should not use this
          method. Use one of the creation functions instead, such as
          ``asarray``.
  
          """
          obj = super().__new__(cls)
          # Note: The spec does not have array scalars, only shape () arrays.
          if isinstance(x, np.generic):
              # Convert the array scalar to a shape () array
              xa = np.empty((), x.dtype)
              xa[()] = x
              x = xa
          obj._array = x
          return obj
  
      # Prevent Array() from working
      def __new__(cls, *args, **kwargs):
          raise TypeError("The array_api Array object should not be instantiated directly. Use an array creation function, such as asarray(), instead.")
  
      # These functions are not required by the spec, but are implemented for
      # the sake of usability.
  
      def __str__(self: Array, /) -> str:
          """
          Performs the operation __str__.
          """
          return self._array.__str__().replace('array', 'Array')
  
      def __repr__(self: Array, /) -> str:
          """
          Performs the operation __repr__.
          """
          return self._array.__repr__().replace('array', 'Array')
  
      # Helper function to match the type promotion rules in the spec
      def _promote_scalar(self, scalar):
          """
          Returns a promoted version of a Python scalar appropriate for use with
          operations on self.
  
          This may raise an OverflowError in cases where the scalar is an
          integer that is too large to fit in a NumPy integer dtype, or
          TypeError when the scalar type is incompatible with the dtype of self.
          """
          if isinstance(scalar, bool):
              if self.dtype not in _boolean_dtypes:
                  raise TypeError("Python bool scalars can only be promoted with bool arrays")
          elif isinstance(scalar, int):
              if self.dtype in _boolean_dtypes:
                  raise TypeError("Python int scalars cannot be promoted with bool arrays")
          elif isinstance(scalar, float):
              if self.dtype not in _floating_dtypes:
                  raise TypeError("Python float scalars can only be promoted with floating-point arrays.")
          else:
              raise TypeError("'scalar' must be a Python scalar")
  
          # Note: the spec only specifies integer-dtype/int promotion
          # behavior for integers within the bounds of the integer dtype.
          # Outside of those bounds we use the default NumPy behavior (either
          # cast or raise OverflowError).
          return Array._new(np.array(scalar, self.dtype))
  
      @staticmethod
      def _normalize_two_args(x1, x2):
          """
          Normalize inputs to two arg functions to fix type promotion
  
  [... the rest is omitted ...]
files: numpy/_array_api/_array_object.py
files: from __future__ import annotations
  
  
  from typing import TYPE_CHECKING, List, Optional, Tuple, Union
  if TYPE_CHECKING:
      from ._types import (NestedSequence, SupportsDLPack,
                           SupportsBufferProtocol, Array, Device, Dtype)
      from collections.abc import Sequence
  from ._dtypes import _all_dtypes
  
  import numpy as np
  
  def asarray(obj: Union[Array, float, NestedSequence[bool|int|float], SupportsDLPack, SupportsBufferProtocol], /, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None, copy: Optional[bool] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`.
  
      See its docstring for more information.
      """
      # _array_object imports in this file are inside the functions to avoid
      # circular imports
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      if copy is not None:
          # Note: copy is not yet implemented in np.asarray
          raise NotImplementedError("The copy keyword argument to asarray is not yet implemented")
      if isinstance(obj, Array) and (dtype is None or obj.dtype == dtype):
          return obj
      if dtype is None and isinstance(obj, int) and (obj > 2**64 or obj < -2**63):
          # Give a better error message in this case. NumPy would convert this
          # to an object array.
          raise OverflowError("Integer out of bounds for array dtypes")
      res = np.asarray(obj, dtype=dtype)
      if res.dtype not in _all_dtypes:
          raise TypeError(f"The array_api namespace does not support the dtype '{res.dtype}'")
      return Array._new(res)
  
  def arange(start: Union[int, float], /, stop: Optional[Union[int, float]] = None, step: Union[int, float] = 1, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.arange(start, stop=stop, step=step, dtype=dtype))
  
  def empty(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.empty(shape, dtype=dtype))
  
  def empty_like(x: Array, /, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.empty_like(x._array, dtype=dtype))
  
  def eye(n_rows: int, n_cols: Optional[int] = None, /, *, k: Optional[int] = 0, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.eye(n_rows, M=n_cols, k=k, dtype=dtype))
  
  def from_dlpack(x: object, /) -> Array:
      # Note: dlpack support is not yet implemented on Array
      raise NotImplementedError("DLPack support is not yet
  
  [... the rest is omitted ...]
files: numpy/_array_api/_creation_functions.py
files: from __future__ import annotations
  
  
  from typing import TYPE_CHECKING, List, Optional, Tuple, Union
  if TYPE_CHECKING:
      from ._types import (NestedSequence, SupportsDLPack,
                           SupportsBufferProtocol, Array, Device, Dtype)
      from collections.abc import Sequence
  from ._dtypes import _all_dtypes
  
  import numpy as np
  
  def asarray(obj: Union[float, NestedSequence[bool|int|float], SupportsDLPack, SupportsBufferProtocol], /, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None, copy: Optional[bool] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`.
  
      See its docstring for more information.
      """
      # _array_object imports in this file are inside the functions to avoid
      # circular imports
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      if copy is not None:
          # Note: copy is not yet implemented in np.asarray
          raise NotImplementedError("The copy keyword argument to asarray is not yet implemented")
      if isinstance(obj, Array) and (dtype is None or obj.dtype == dtype):
          return obj
      if dtype is None and isinstance(obj, int) and (obj > 2**64 or obj < -2**63):
          # Give a better error message in this case. NumPy would convert this
          # to an object array.
          raise OverflowError("Integer out of bounds for array dtypes")
      res = np.asarray(obj, dtype=dtype)
      if res.dtype not in _all_dtypes:
          raise TypeError(f"The array_api namespace does not support the dtype '{res.dtype}'")
      return Array._new(res)
  
  def arange(start: Union[int, float], /, stop: Optional[Union[int, float]] = None, step: Union[int, float] = 1, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.arange(start, stop=stop, step=step, dtype=dtype))
  
  def empty(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.empty(shape, dtype=dtype))
  
  def empty_like(x: Array, /, *, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.empty_like(x._array, dtype=dtype))
  
  def eye(n_rows: int, n_cols: Optional[int] = None, /, *, k: Optional[int] = 0, dtype: Optional[Dtype] = None, device: Optional[Device] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if device is not None:
          # Note: Device support is not yet implemented on Array
          raise NotImplementedError("Device support is not yet implemented")
      return Array._new(np.eye(n_rows, M=n_cols, k=k, dtype=dtype))
  
  def from_dlpack(x: object, /) -> Array:
      # Note: dlpack support is not yet implemented on Array
      raise NotImplementedError("DLPack support is not yet implemented")
  
  
  
  [... the rest is omitted ...]
files: numpy/_array_api/_creation_functions.py
files: from __future__ import annotations
  
  from ._array_object import Array
  
  from dataclasses import dataclass
  from typing import TYPE_CHECKING
  if TYPE_CHECKING:
      from ._types import List, Tuple, Union, Dtype
      from collections.abc import Sequence
  
  import numpy as np
  
  def broadcast_arrays(*arrays: Sequence[Array]) -> List[Array]:
      """
      Array API compatible wrapper for :py:func:`np.broadcast_arrays <numpy.broadcast_arrays>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      return [Array._new(array) for array in np.broadcast_arrays(*[a._array for a in arrays])]
  
  def broadcast_to(x: Array, /, shape: Tuple[int, ...]) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.broadcast_to <numpy.broadcast_to>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      return Array._new(np.broadcast_to(x._array, shape))
  
  def can_cast(from_: Union[Dtype, Array], to: Dtype, /) -> bool:
      """
      Array API compatible wrapper for :py:func:`np.can_cast <numpy.can_cast>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if isinstance(from_, Array):
          from_ = from_._array
      return np.can_cast(from_, to)
  
  # These are internal objects for the return types of finfo and iinfo, since
  # the NumPy versions contain extra data that isn't part of the spec.
  @dataclass
  class finfo_object:
      bits: int
      # Note: The types of the float data here are float, whereas in NumPy they
      # are scalars of the corresponding float dtype.
      eps: float
      max: float
      min: float
      # Note: smallest_normal is part of the array API spec, but cannot be used
      # until https://github.com/numpy/numpy/pull/18536 is merged.
  
      # smallest_normal: float
  
  @dataclass
  class iinfo_object:
      bits: int
      max: int
      min: int
  
  def finfo(type: Union[Dtype, Array], /) -> finfo_object:
      """
      Array API compatible wrapper for :py:func:`np.finfo <numpy.finfo>`.
  
      See its docstring for more information.
      """
      fi = np.finfo(type)
      # Note: The types of the float data here are float, whereas in NumPy they
      # are scalars of the corresponding float dtype.
      return finfo_object(
          fi.bits,
          float(fi.eps),
          float(fi.max),
          float(fi.min),
          # TODO: Uncomment this when #18536 is merged.
          # float(fi.smallest_normal),
      )
  
  def iinfo(type: Union[Dtype, Array], /) -> iinfo_object:
      """
      Array API compatible wrapper for :py:func:`np.iinfo <numpy.iinfo>`.
  
      See its docstring for more information.
      """
      ii = np.iinfo(type)
      return iinfo_object(ii.bits, ii.max, ii.min)
  
  def result_type(*arrays_and_dtypes: Sequence[Union[Array, Dtype]]) -> Dtype:
      """
      Array API compatible wrapper for :py:func:`np.result_type <numpy.result_type>`.
  
      See its docstring for more information.
      """
      return np.result_type(*(a._array if isinstance(a, Array) else a for a in arrays_and_dtypes))
  
  
  [... the rest is omitted ...]
files: numpy/_array_api/_data_type_functions.py
files: from __future__ import annotations
  
  from ._array_object import Array
  
  from typing import TYPE_CHECKING
  if TYPE_CHECKING:
      from ._types import List, Tuple, Union, Dtype
      from collections.abc import Sequence
  
  import numpy as np
  
  def broadcast_arrays(*arrays: Sequence[Array]) -> List[Array]:
      """
      Array API compatible wrapper for :py:func:`np.broadcast_arrays <numpy.broadcast_arrays>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      return [Array._new(array) for array in np.broadcast_arrays(*[a._array for a in arrays])]
  
  def broadcast_to(x: Array, /, shape: Tuple[int, ...]) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.broadcast_to <numpy.broadcast_to>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      return Array._new(np.broadcast_to(x._array, shape))
  
  def can_cast(from_: Union[Dtype, Array], to: Dtype, /) -> bool:
      """
      Array API compatible wrapper for :py:func:`np.can_cast <numpy.can_cast>`.
  
      See its docstring for more information.
      """
      from ._array_object import Array
      if isinstance(from_, Array):
          from_ = from_._array
      return np.can_cast(from_, to)
  
  def finfo(type: Union[Dtype, Array], /) -> finfo_object:
      """
      Array API compatible wrapper for :py:func:`np.finfo <numpy.finfo>`.
  
      See its docstring for more information.
      """
      return np.finfo(type)
  
  def iinfo(type: Union[Dtype, Array], /) -> iinfo_object:
      """
      Array API compatible wrapper for :py:func:`np.iinfo <numpy.iinfo>`.
  
      See its docstring for more information.
      """
      return np.iinfo(type)
  
  def result_type(*arrays_and_dtypes: Sequence[Union[Array, Dtype]]) -> Dtype:
      """
      Array API compatible wrapper for :py:func:`np.result_type <numpy.result_type>`.
  
      See its docstring for more information.
      """
      return np.result_type(*(a._array if isinstance(a, Array) else a for a in arrays_and_dtypes))
  
  
  [... the rest is omitted ...]
files: numpy/_array_api/_data_type_functions.py
files: from __future__ import annotations
  
  from ._array_object import Array
  
  from typing import List, Optional, Tuple, Union
  
  import numpy as np
  
  # Note: the function name is different here
  def concat(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: Optional[int] = 0) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`.
  
      See its docstring for more information.
      """
      arrays = tuple(a._array for a in arrays)
      return Array._new(np.concatenate(arrays, axis=axis))
  
  def expand_dims(x: Array, /, *, axis: int) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.expand_dims <numpy.expand_dims>`.
  
      See its docstring for more information.
      """
      return Array._new(np.expand_dims(x._array, axis))
  
  def flip(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.flip <numpy.flip>`.
  
      See its docstring for more information.
      """
      return Array._new(np.flip(x._array, axis=axis))
  
  def reshape(x: Array, /, shape: Tuple[int, ...]) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.reshape <numpy.reshape>`.
  
      See its docstring for more information.
      """
      return Array._new(np.reshape(x._array, shape))
  
  def roll(x: Array, /, shift: Union[int, Tuple[int, ...]], *, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.roll <numpy.roll>`.
  
      See its docstring for more information.
      """
      return Array._new(np.roll(x._array, shift, axis=axis))
  
  def squeeze(x: Array, /, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.squeeze <numpy.squeeze>`.
  
      See its docstring for more information.
      """
      return Array._new(np.squeeze(x._array, axis=axis))
  
  def stack(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: int = 0) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`.
  
      See its docstring for more information.
      """
      arrays = tuple(a._array for a in arrays)
      return Array._new(np.stack(arrays, axis=axis))
  
  
  [... the rest is omitted ...]
files: numpy/_array_api/_manipulation_functions.py
files: from __future__ import annotations
  
  from ._array_object import Array
  
  from typing import List, Optional, Tuple, Union
  
  import numpy as np
  
  # Note: the function name is different here
  def concat(arrays: Tuple[Array, ...], /, *, axis: Optional[int] = 0) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`.
  
      See its docstring for more information.
      """
      arrays = tuple(a._array for a in arrays)
      return Array._new(np.concatenate(arrays, axis=axis))
  
  def expand_dims(x: Array, /, *, axis: int) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.expand_dims <numpy.expand_dims>`.
  
      See its docstring for more information.
      """
      return Array._new(np.expand_dims(x._array, axis))
  
  def flip(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.flip <numpy.flip>`.
  
      See its docstring for more information.
      """
      return Array._new(np.flip(x._array, axis=axis))
  
  def reshape(x: Array, /, shape: Tuple[int, ...]) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.reshape <numpy.reshape>`.
  
      See its docstring for more information.
      """
      return Array._new(np.reshape(x._array, shape))
  
  def roll(x: Array, /, shift: Union[int, Tuple[int, ...]], *, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.roll <numpy.roll>`.
  
      See its docstring for more information.
      """
      return Array._new(np.roll(x._array, shift, axis=axis))
  
  def squeeze(x: Array, /, axis: Optional[Union[int, Tuple[int, ...]]] = None) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.squeeze <numpy.squeeze>`.
  
      See its docstring for more information.
      """
      return Array._new(np.squeeze(x._array, axis=axis))
  
  def stack(arrays: Tuple[Array, ...], /, *, axis: int = 0) -> Array:
      """
      Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`.
  
      See its docstring for more information.
      """
      arrays = tuple(a._array for a in arrays)
      return Array._new(np.stack(arrays, axis=axis))
  
  
  [... the rest is omitted ...]
files: numpy/_array_api/_manipulation_functions.py