def crop(img, left, top, right, bottom):
    """
    Crop rectangle from image.

    Inputs:
        img - The image to crop.
        left - The leftmost index to crop the image.
        top - The topmost index.
        right - The rightmost index.
        bottom - The bottommost index.
    Outputs:
        img - The cropped image.
    """

    return img[left:right, top:bottom]