code: def safe_int(string, default=None):
      
      value = safe_float(string, default)
      if value is not None:
          value = int(value)
      return value
docs: Safely parse a string into an int.
  
      On error return the ``default`` value.
  
      :param string string: string value to be converted
      :param int default: default value to be used in case of failure
      :rtype: int