import re


def postProcessOutputForPython(contents):
  """Do post-processing on the final output for Python."""

  # Friggin' doxygen escapes HTML character codes it doesn't understand, so
  # the hack we have to do for Javadoc turns out doesn't work for the Python
  # documentation.  Kluge around it.

  contents = re.sub(r'\\f\$\\geq\\f\$', '>=', contents)
  contents = re.sub(r'\\f\$\\leq\\f\$', '<=', contents)
  contents = re.sub(r'\\f\$\\times\\f\$', '*', contents)

  # Doxygen doesn't understand <nobr>.

  contents = re.sub(r'</?nobr>', '', contents)

  return contents