code: def integer(token):
          
          token = token.strip()
          neg = False
          if token.startswith(compat.b('-')):
              token = token[1:]
              neg = True
          if token.startswith(compat.b('0x')):
              result = int(token, 16)     # hexadecimal
          elif token.startswith(compat.b('0b')):
              result = int(token[2:], 2)  # binary
          elif token.startswith(compat.b('0o')):
              result = int(token, 8)      # octal
          else:
              try:
                  result = int(token)     # decimal
              except ValueError:
                  result = int(token, 16) # hexadecimal (no "0x" prefix)
          if neg:
              result = -result
          return result
docs: Convert numeric strings into integers.
  
          @type  token: str
          @param token: String to parse.
  
          @rtype:  int
          @return: Parsed integer value.