Handle processing when the result argument provided is an integer.
769613
def _handle_result_by_index(self, idx):
        
        if idx < 0:
            return None
        opts = dict(self.options)
        skip = opts.pop('skip', 0)
        limit = opts.pop('limit', None)
        py_to_couch_validate('skip', skip)
        py_to_couch_validate('limit', limit)
        if limit is not None and idx >= limit:
            # Result is out of range
            return dict()
        return self._ref(skip=skip+idx, limit=1, **opts)
726555
def validate_integer(option, value):
    
    if isinstance(value, integer_types):
        return value
    elif isinstance(value, string_type):
        try:
            return int(value)
        except ValueError:
            raise ValueError("The value of %s must be "
                             "an integer" % (option,))
    raise TypeError("Wrong type for %s, value must be an integer" % (option,))
39252
def result(self, value):
        """"""
        if self._process_result:
            self._result = self._process_result(value)

        self._raw_result = value
682038
def handle_result(self, result, error):
        
        if not self._error and not self._result:
            # Store results, if not already set
            self._error = error
            self._result = result

        # Unlock the call
        self._event.set()
1333241
def check_positive_integer(name, value):
    
    try:
        value = int(value)
        is_positive = (value > 0)
    except ValueError:
        raise ValueError('%s should be an integer; got %r' % (name, value))

    if is_positive:
        return value
    else:
        raise ValueError('%s should be positive; got %r' % (name, value))
132260
def process_number(line, base, str)
      value = str.to_i base
      case value
      when Fixnum
        AST::FixnumLiteral.new line, value
      when Bignum
        AST::NumberLiteral.new line, value
      end
    end
757178
protected void handleSigInt() {
		if (this.commandRunner.handleSigInt()) {
			return;
		}
		System.out.println(String.format("%nThanks for using Spring Boot"));
		System.exit(1);
	}
406828
def process_result_value(self, value, dialect):
        """"""
        if value is not None:
            with BytesIO(value) as stream:
                with GzipFile(fileobj=stream, mode="rb") as file_handle:
                    value = json.loads(file_handle.read().decode("utf-8"))
        return value
675429
def is_integer(value: Any) -> bool:
    """"""
    return (isinstance(value, int) and not isinstance(value, bool)) or (
        isinstance(value, float) and isfinite(value) and int(value) == value
    )
966332
private void evalNumber(MessageArg arg) {
    initDecimalArgsParser();
    parseArgs(decimalArgsParser);
    
    BigDecimal number = arg.asBigDecimal();
    NumberFormatter formatter = CLDR_INSTANCE.getNumberFormatter(locale);
    formatter.formatDecimal(number, buf, decimalArgsParser.options());
  }
543945
private static void ensureNumber(Object value) throws ExecutionException {

        if (!isNumber(value)) {
            String message = value.getClass().getCanonicalName() + " can not cast to a Number.";
            LOGGER.error(message);
            throw new ExecutionException(message);
        }
    }
630924
def int_or_str(v: Optional[str]) -> Union[None, int, str]:
    """"""
    if v is None:
        return
    try:
        return int(v)
    except ValueError:
        return v
471591
def getSizedInteger(self, data, byteSize, as_number=False):
        """"""
        result = 0
        if byteSize == 0:
            raise InvalidPlistException("Encountered integer with byte size of 0.")
        # 1, 2, and 4 byte integers are unsigned
        elif byteSize == 1:
            result = unpack('>B', data)[0]
        elif byteSize == 2:
            result = unpack('>H', data)[0]
        elif byteSize == 4:
            result = unpack('>L', data)[0]
        elif byteSize == 8:
            if as_number:
                result = unpack('>q', data)[0]
            else:
                result = unpack('>Q', data)[0]
        elif byteSize <= 16:
            # Handle odd-sized or integers larger than 8 bytes
            # Don't naively go over 16 bytes, in order to prevent infinite loops.
            result = 0
            if hasattr(int, 'from_bytes'):
                result = int.from_bytes(data, 'big')
            else:
                for byte in data:
                    if not isinstance(byte, int): # Python3.0-3.1.x return ints, 2.x return str
                        byte = unpack_from('>B', byte)[0]
                    result = (result << 8) | byte
        else:
            raise InvalidPlistException("Encountered integer longer than 16 bytes.")
        return result
145517
def validate_positive_integer(option, value):
    
    val = validate_integer(option, value)
    if val <= 0:
        raise ValueError("The value of %s must be "
                         "a positive integer" % (option,))
    return val
1316205
def process_result_value(
        self,
        value,  # type: typing.Union[str, typing.Any]
        dialect  # type: DefaultDialect
    ):  # type: (...) -> typing.Any
        """"""
        if self.__use_json(dialect) or value is None:
            return value

        return self.__json_codec.loads(value)
117247
def process_result_value(self, value, dialect):
        
        if value is None:
            return None

        p = value.split("|")

        if len(p) == 0:
            return None
        return SourceLocation(*map(int, p))
1282102
static int parseInt(String key, @Nullable String value) {
    requireArgument((value != null) && !value.isEmpty(), "value of key %s was omitted", key);
    try {
      return Integer.parseInt(value);
    } catch (NumberFormatException e) {
      throw new IllegalArgumentException(String.format(
          "key %s value was set to %s, must be an integer", key, value), e);
    }
  }