def parse_int(s):
  """A function that attempts to convert the input string into an int.

  Returns None if the input is not a valid int.

  Args:
    s: String to convert.

  Returns:
    int if s is a valid int string, otherwise None.
  """
  try:
    return int(s)
  except ValueError:
    return None