code: def _ConvertInteger(value):
      """Convert an integer.
  
      Args:
        value: A scalar value to convert.
  
      Returns:
        The integer value.
  
      Raises:
        ParseError: If an integer couldn't be consumed.
      """
      if isinstance(value, float) and not value.is_integer():
          raise ParseError("Couldn't parse integer: {0}.".format(value))
  
      if isinstance(value, str) and value.find(" ") != -1:
          raise ParseError(
              'Couldn\'t parse integer: "{0}".'.format(value)
          )
  
      if isinstance(value, bool):
          raise ParseError(
              "Bool value {0} is not acceptable for "
              "integer field.".format(value)
          )
  
      return int(value)
  
imports: import base64
  from collections import OrderedDict
  import json
  import math
  from operator import methodcaller
  import re
  import sys
  from google.protobuf.internal import type_checkers
  from google.protobuf import descriptor
  from google.protobuf import symbol_database
label_desc: Use image node_id 10 for calling a global function with example usage: _ConvertInteger(value) and returns: int