def rotate_img(im, deg, mode=cv2.BORDER_CONSTANT, interpolation=cv2.INTER_AREA):
r,c,*_ = im.shape<EOL>M = cv2.getRotationMatrix2D((c//<NUM_LIT:2>,r//<NUM_LIT:2>),deg,<NUM_LIT:1>)<EOL>return cv2.warpAffine(im,M,(c,r), borderMode=mode, flags=cv2.WARP_FILL_OUTLIERS+interpolation)<EOL>
Rotates an image by deg degrees

    Arguments:
        deg (float): degree to rotate.