async def write_response(self, stream, code, lines="<STR_LIT>", list=False):
lines = wrap_with_container(lines)<EOL>write = functools.partial(self.write_line, stream)<EOL>if list:<EOL><INDENT>head, *body, tail = lines<EOL>await write(code + "<STR_LIT:->" + head)<EOL>for line in body:<EOL><INDENT>await write("<STR_LIT:U+0020>" + line)<EOL><DEDENT>await write(code + "<STR_LIT:U+0020>" + tail)<EOL><DEDENT>else:<EOL><INDENT>*body, tail = lines<EOL>for line in body:<EOL><INDENT>await write(code + "<STR_LIT:->" + line)<EOL><DEDENT>await write(code + "<STR_LIT:U+0020>" + tail)<EOL><DEDENT>
:py:func:`asyncio.coroutine`

Complex method for sending response.

:param stream: command connection stream
:type stream: :py:class:`aioftp.StreamIO`

:param code: server response code
:type code: :py:class:`str`

:param lines: line or lines, which are response information
:type lines: :py:class:`str` or :py:class:`collections.Iterable`

:param list: if true, then lines will be sended without code prefix.
    This is useful for **LIST** FTP command and some others.
:type list: :py:class:`bool`