code: def string_to_integer(value, strict=False):
      
      if is_undefined(value):
          if strict:
              raise ValueError('The value cannot be null')
          return None
  
      try:
          return int(value)
  
      except ValueError:
          raise ValueError('The specified string "%s" does not represent an integer' % value)
docs: Return an integer corresponding to the string representation of a
      number.
  
      @param value: a string representation of an integer number.
  
      @param strict:  indicate whether the specified string MUST be of a
          valid integer number representation.
  
      @return: the integer value represented by the string.
  
      @raise ValueError: if the string doesn't represent a valid integer,
          while the argument ``strict`` equals ``True``.