def METHOD_NAME(a, offset=0, axis1=0, axis2=1):
    """Returns specified diagonals.
    This function extracts the diagonals along two specified axes. The other
    axes are not changed. This function returns a writable view of this array
    as NumPy 1.10 will do.
    Args:
        a (cupy.ndarray): Array from which the diagonals are taken.
        offset (int): Index of the diagonals. Zero indicates the main
            diagonals, a positive value upper diagonals, and a negative value
            lower diagonals.
        axis1 (int): The first axis to take diagonals from.
        axis2 (int): The second axis to take diagonals from.
    Returns:
        cupy.ndarray: A view of the diagonals of ``a``.
    .. seealso:: :func:`numpy.diagonal`
    """
    # TODO(okuta): check type
    return a.METHOD_NAME(offset, axis1, axis2)