def METHOD_NAME(value):
    try:
        value = float(value)
    except (ValueError, TypeError):
        raise argparse.ArgumentTypeError(_('Invalid zoom'))
    if not (0 < value <= 32):
        raise argparse.ArgumentTypeError(_('Zoom has to be between 0 and 32'))
    return value