code: def filter_quotes (text, is_email=True):
      
      global DEBUG
      global PAT_FORWARD, PAT_REPLIED, PAT_UNSUBSC
  
      if is_email:
          text = filter(lambda x: x in string.printable, text)
  
          if DEBUG:
              print("text:", text)
  
          # strip off quoted text in a forward
          m = PAT_FORWARD.split(text, re.M)
  
          if m and len(m) > 1:
              text = m[0]
  
          # strip off quoted text in a reply
          m = PAT_REPLIED.split(text, re.M)
  
          if m and len(m) > 1:
              text = m[0]
  
          # strip off any trailing unsubscription notice
          m = PAT_UNSUBSC.split(text, re.M)
  
          if m:
              text = m[0]
  
      # replace any remaining quoted text with blank lines
      lines = []
  
      for line in text.split("\n"):
          if line.startswith(">"):
              lines.append("")
          else:
              lines.append(line)
  
      return list(split_grafs(lines))
docs: filter the quoted text out of a message