def strip_email_quotes(text):
lines = text.splitlines()<EOL>matches = set()<EOL>for line in lines:<EOL><INDENT>prefix = re.match(r'<STR_LIT>', line)<EOL>if prefix:<EOL><INDENT>matches.add(prefix.group(<NUM_LIT:1>))<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>prefix = long_substr(list(matches))<EOL>if prefix:<EOL><INDENT>strip = len(prefix)<EOL>text = '<STR_LIT:\n>'.join([ ln[strip:] for ln in lines])<EOL><DEDENT><DEDENT>return text<EOL>
Strip leading email quotation characters ('>').

    Removes any combination of leading '>' interspersed with whitespace that
    appears *identically* in all lines of the input text.

    Parameters
    ----------
    text : str

    Examples
    --------

    Simple uses::

        In [2]: strip_email_quotes('> > text')
        Out[2]: 'text'

        In [3]: strip_email_quotes('> > text\\n> > more')
        Out[3]: 'text\\nmore'

    Note how only the common prefix that appears in all lines is stripped::

        In [4]: strip_email_quotes('> > text\\n> > more\\n> more...')
        Out[4]: '> text\\n> more\\nmore...'

    So if any line has no quote marks ('>') , then none are stripped from any
    of them ::

        In [5]: strip_email_quotes('> > text\\n> > more\\nlast different')
        Out[5]: '> > text\\n> > more\\nlast different'