def take(
        self,
        indices: Any,
        axis: Any = None,
        out: ndarray | None = None,
        mode: BoundsMode = "raise",
    ) -> ndarray:
        """a.take(indices, axis=None, out=None, mode="raise")

        Take elements from an array along an axis.

        Refer to :func:`cupynumeric.take` for full documentation.

        See Also
        --------
        cupynumeric.take : equivalent function

        Availability
        --------
        Multiple GPUs, Multiple CPUs

        """
        if not np.isscalar(indices):
            # if indices is a tuple or list, bring sub-tuples to the same shape
            # and concatenate them
            indices = convert_to_cupynumeric_ndarray(indices)

        if axis is None:
            self = self.ravel()
            axis = 0
        else:
            axis = normalize_axis_index(axis, self.ndim)

        # TODO remove "raise" logic when bounds check for advanced
        # indexing is implementd
        if mode == "raise":
            if np.isscalar(indices):
                if (indices < -self.shape[axis]) or (
                    indices >= self.shape[axis]
                ):
                    raise IndexError("invalid entry in indices array")
            else:
                if (indices < -self.shape[axis]).any() or (
                    indices >= self.shape[axis]
                ).any():
                    raise IndexError("invalid entry in indices array")
        elif mode == "wrap":
            indices = indices % self.shape[axis]
        elif mode == "clip":
            if np.isscalar(indices):
                if indices >= self.shape[axis]:
                    indices = self.shape[axis] - 1
                if indices < 0:
                    indices = 0
            else:
                indices = indices.clip(0, self.shape[axis] - 1)
        else:
            raise ValueError(
                "Invalid mode '{}' for take operation".format(mode)
            )
        if self.shape[axis] == 0:
            if indices.size != 0:
                raise IndexError(
                    "Cannot do a non-empty take() from an empty axis."
                )
            return self.copy()

        point_indices = tuple(slice(None) for i in range(0, axis))
        point_indices += (indices,)
        if out is not None:
            if out.dtype != self.dtype:
                raise TypeError("Type mismatch: out array has the wrong type")
            out[:] = self[point_indices]
            return out
        else:
            res = self[point_indices]
            if np.isscalar(indices):
                res = res.copy()
            return res
a.take(indices, axis=None, out=None, mode="raise")

        Take elements from an array along an axis.

        Refer to :func:`cupynumeric.take` for full documentation.

        See Also
        --------
        cupynumeric.take : equivalent function

        Availability
        --------
        Multiple GPUs, Multiple CPUs

        
cupynumeric/_array/array.py