def check_non_negative_int(value):
    try:
        value = int(value)
    except __HOLE__:
        raise argparse.ArgumentTypeError(_("invalid int value: %r") % value)
    if value < 0:
        raise argparse.ArgumentTypeError(_("input value %d is negative") %
                                         value)
    return value
dataset/ETHPy150Open openstack/python-neutronclient/neutronclient/shell.py/check_non_negative_int