def assembleFormattedText(formatted):
    """
    Assemble formatted text from structured information.

    Currently handled formatting includes: bold, blink, reverse, underline and
    color codes.

    For example::

        from twisted.conch.insults.text import attributes as A
        assembleFormattedText(
            A.normal[A.bold['Time: '], A.fg.lightRed['Now!']])

    Would produce "Time: " in bold formatting, followed by "Now!" with a
    foreground color of light red and without any additional formatting.

    @param formatted: Structured text and attributes.

    @rtype: L{str}
    @return: String containing VT102 control sequences that mimic those
        specified by C{formatted}.

    @see: L{twisted.conch.insults.text._CharacterAttributes}
    @since: 13.1
    """
    return _textattributes.flatten(
        formatted, helper._FormattingState(), 'toVT102')

    Assemble formatted text from structured information.

    Currently handled formatting includes: bold, blink, reverse, underline and
    color codes.

    For example::

        from twisted.conch.insults.text import attributes as A
        assembleFormattedText(
            A.normal[A.bold['Time: '], A.fg.lightRed['Now!']])

    Would produce "Time: " in bold formatting, followed by "Now!" with a
    foreground color of light red and without any additional formatting.

    @param formatted: Structured text and attributes.

    @rtype: L{str}
    @return: String containing VT102 control sequences that mimic those
        specified by C{formatted}.

    @see: L{twisted.conch.insults.text._CharacterAttributes}
    @since: 13.1
    
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/insults/text.py