def clean_pre(soup):
  """Adds our prettyprint class to PRE and removes some troubelsome tags."""
  for pre in soup.find_all('pre'):
    pre['class'] = 'language-cpp'
    # This effectively deletes the wrapper DIV and P tags that cause issues
    parent_p = pre.find_parent('p')
    if parent_p:
      parent_p.replace_with(pre)
  return soup