def safe_int(val, allow_zero=True):
    try:
        ret = int(val)
    except ValueError:
        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
Validates the semantic protobuf for internal consistency.
dataset/ETHPy150Open rackspace/pyrax/samples/autoscale/add_webhook.py/safe_int--crossover with--dataset/ETHPy150Open google/grr/grr/lib/rdfvalues/structs.py/RDFProtoStruct.Validate