code: def find_unwrap_start(lines, max_wrap_lines, min_header_lines, min_quoted_lines):
      
  
      for n, line in enumerate(lines):
          if not line.strip():
              continue
  
          # Find a forward / reply start pattern
  
          end, typ = find_pattern_on_line(lines, n, max_wrap_lines)
          if typ:
              return n, end, typ
  
          # Find a quote
          if line.startswith('>'):
              # Check if there are at least min_quoted_lines lines that match
              matched_lines = 1
  
              if matched_lines >= min_quoted_lines:
                  return n, n, 'quoted'
  
              for peek_line in lines[n+1:]:
                  if not peek_line.strip():
                      continue
                  if not peek_line.startswith('>'):
                      break
                  else:
                      matched_lines += 1
                  if matched_lines >= min_quoted_lines:
                      return n, n, 'quoted'
  
          # Find a header
          match = HEADER_RE.match(line)
          if match:
              if len(extract_headers(lines[n:], max_wrap_lines)[0]) >= min_header_lines:
                  return n, n, 'headers'
  
      return None, None, None
docs: Finds the starting point of a wrapped email. Returns a tuple containing
      (start_line_number, end_line_number, type), where type can be one of the
      following:
  
       * 'forward': A matching forwarding pattern was found
       * 'reply': A matching reply pattern was found
       * 'headers': Headers were found (usually a forwarded email)
       * 'quote': A quote was found
  
      start_line_number corresponds to the line number where the forwarding/reply
      pattern starts, or where the headers/quote starts. end_line_number is only
      different from start_line_number if the forwarding/reply pattern spans over
      multiple lines (it does not extend to the end of the headers or of the
      quoted section).
  
      Returns (None, None, None) if nothing was found.