Fix the following code, and try do some refactoring:

def draw_crop(image, boxes, display=False):
    '''
    Read the input file given and return the image with resize if asked

    image -- input image - cv mat
    boxes -- boxes to draw on the image - list
    display -- Display the image or not - Boolean

    return :
    image_with_docs -- image with boxes drawn on it
    '''
    boites = boxes
    im = image.copy()
    for box in boxes:
        x, y, w, h = box
        cv2.rectangle(image_with_docs, (x, y), (x+w, y+h), (0, 255, 0), 2)

    if display:
        cv2.imshow("Documents", image_with_docs)
        cv2.waitKey(0)

    return boites You should write your response with 500 or more words.
user