code: def convert_response_to_text(response):
      
      # Responses are sent as html. Split on the newlines and give us
      # the <p> text back.
      errorlines = response.text.encode("utf-8").split("\n")
      error = []
      pattern = re.compile(r"<p.*>(.*)</p>")
      for line in errorlines:
          content_line = re.search(pattern, line)
          if content_line:
              error.append(content_line.group(1))
  
      return ". ".join(error)
docs: Convert a JSS HTML response to plaintext.