docs: def to_int(value: str, default: T = None) -> Union[int, Optional[T]]:
      """Convert given value to int.
  
      If conversion failed, return default value without raising Exception.
  
      :param value: Value to convert to int.
      :param default: Default value to use in case of failed conversion.
      """
      try:
          return int(value)
      except (TypeError, ValueError):
          return default