code: def extract_from_html(msg_body):
      
      if isinstance(msg_body, six.text_type):
          msg_body = msg_body.encode('utf8')
      elif not isinstance(msg_body, bytes):
          msg_body = msg_body.encode('ascii')
  
      result = _extract_from_html(msg_body)
      if isinstance(result, bytes):
          result = result.decode('utf8')
  
      return result
docs: Extract not quoted message from provided html message body
      using tags and plain text algorithm.
  
      Cut out the 'blockquote', 'gmail_quote' tags.
      Cut Microsoft quotations.
  
      Then use plain text algorithm to cut out splitter or
      leftover quotation.
      This works by adding checkpoint text to all html tags,
      then converting html to text,
      then extracting quotations from text,
      then checking deleted checkpoints,
      then deleting necessary tags.
  
      Returns a unicode string.