def _parseIntegerArgument(args, key, defaultValue):
    """
    Attempts to parse the specified key in the specified argument
    dictionary into an integer. If the argument cannot be parsed,
    raises a BadRequestIntegerException. If the key is not present,
    return the specified default value.
    """
    ret = defaultValue
    if key in args:
        try:
            ret = int(args[key])
        except __HOLE__:
            raise exceptions.BadRequestIntegerException(key, args[key])
    return ret
dataset/ETHPy150Open ga4gh/server/ga4gh/backend.py/_parseIntegerArgument