def validate_int(input, min_value, max_value):
    try:
        number = int(input)
    except ValueError:
        raise UsageError('Input must be an integer')
    if min_value <= number <= max_value:
        return number
    else:
        raise UsageError('Input must be between {} and {}'.format(min_value, max_value))
dataset/ETHPy150Open pimutils/khal/khal/configwizard.py/validate_int/original