def convert_rotation(ctx, param, value):
    if value is None:
        return
    value = value.lower()
    if value in ('90', 'r', 'right'):
        return (Image.ROTATE_90, 90)
    if value in ('180', '-180'):
        return (Image.ROTATE_180, 180)
    if value in ('-90', '270', 'l', 'left'):
        return (Image.ROTATE_270, 270)
    raise click.BadParameter('invalid rotation "%s"' % value)
dataset/ETHPy150Open pallets/click/examples/imagepipe/imagepipe.py/convert_rotation/original