import math


def parse_float(s):
  """A function that attempts to convert the input string into a float.

  Returns None if the input is not a valid float, or if the input is NaN.

  Args:
    s: String to convert.

  Returns:
    float if s is a valid float string that is not NaN, otherwise None.
  """
  try:
    f = float(s)
  except ValueError:
    return None
  return None if math.isnan(f) else f