def do_rotate(img, rotation):
    if not rotation:
        return img

    try:
        rotation = float(rotation)
    except ValueError:
        rotation = 0

    if rotation % 90 == 0:
        img = img.rotate(rotation, pil.NEAREST, expand=True)
    else:
        img = img.rotate(rotation, pil.BICUBIC , expand=True)

    return img
dataset/ETHPy150Open francescortiz/image/image/utils.py/do_rotate/original