def convert_flip(ctx, param, value):
    if value is None:
        return
    value = value.lower()
    if value in ('lr', 'leftright'):
        return (Image.FLIP_LEFT_RIGHT, 'left to right')
    if value in ('tb', 'topbottom', 'upsidedown', 'ud'):
        return (Image.FLIP_LEFT_RIGHT, 'top to bottom')
    raise click.BadParameter('invalid flip "%s"' % value)
dataset/ETHPy150Open pallets/click/examples/imagepipe/imagepipe.py/convert_flip/original