def diagonal(
        self,
        offset: int = 0,
        axis1: int = 0,
        axis2: int = 1,
        extract: bool = True,
    ) -> ndarray:
        """a.diagonal(offset=0, axis1=None, axis2=None)

        Return specified diagonals.

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

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

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

        """
        if self.ndim == 1:
            if extract is True:
                raise ValueError("extract can be true only for Ndim >=2")
            axes = None
        else:
            axes = (axis1, axis2)
        return self._diag_helper(offset=offset, axes=axes, extract=extract)
a.diagonal(offset=0, axis1=None, axis2=None)

        Return specified diagonals.

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

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

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

        
cupynumeric/_array/array.py