code: def rst_underline(heading: str, underline_char: str) -> str:
      
      assert "\n" not in heading
      assert len(underline_char) == 1
      return heading + "\n" + (underline_char * len(heading))
docs: Underlines a heading for RST files.
  
      Args:
          heading: text to underline
          underline_char: character to use
  
      Returns:
          underlined heading, over two lines (without a final terminating
          newline)