def safe_int(val, allow_zero=True):
    """
    This function converts the six.moves.input values to integers. It handles
    invalid entries, and optionally forbids values of zero.
    """
    try:
        ret = int(val)
    except __HOLE__:
        print("Sorry, '%s' is not a valid integer." % val)
        return False
    if not allow_zero and ret == 0:
        print("Please enter a non-zero integer.")
        return False
    return ret

# Get the current scaling groups
dataset/ETHPy150Open rackspace/pyrax/samples/autoscale/add_webhook.py/safe_int