def formatListResponse(msgs):
    """
    Format a list of message sizes into a complete LIST response.

    This generator function is intended to be used with
    L{Cooperator <twisted.internet.task.Cooperator>}.

    @type msgs: L{list} of L{int}
    @param msgs: A list of message sizes.

    @rtype: L{bytes}
    @return: Yields a series of strings which make up a complete LIST response.
    """
    yield successResponse(intToBytes(len(msgs)))
    for ele in formatListLines(msgs):
        yield ele
    yield b'.\r\n'

    Format a list of message sizes into a complete LIST response.

    This generator function is intended to be used with
    L{Cooperator <twisted.internet.task.Cooperator>}.

    @type msgs: L{list} of L{int}
    @param msgs: A list of message sizes.

    @rtype: L{bytes}
    @return: Yields a series of strings which make up a complete LIST response.
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/mail/pop3.py