<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def shift_image(im, shift, borderValue=0):
 """shift the image Parameters im: 2d array The image shift: 2 numbers (y,x) the shift in y and x direction borderValue: number, default 0 The value for the pixels outside the border (default 0) Returns ------- im: 2d array The shifted image Notes ----- The output image has the same size as the input. Therefore the image will be cropped in the process. """

    im = np.asarray(im, dtype=np.float32)
    rows, cols = im.shape
    M = np.asarray([[1, 0, shift[1]], [0, 1, shift[0]]], dtype=np.float32)
    return cv2.warpAffine(im, M, (cols, rows),
                          borderMode=cv2.BORDER_CONSTANT,
                          flags=cv2.INTER_CUBIC,
                          borderValue=borderValue)