def create_reply(reply, message=None, render=False):
r = None<EOL>if not reply:<EOL><INDENT>r = EmptyReply()<EOL><DEDENT>elif isinstance(reply, BaseReply):<EOL><INDENT>r = reply<EOL>if message:<EOL><INDENT>r.source = message.target<EOL>r.target = message.source<EOL><DEDENT><DEDENT>elif isinstance(reply, six.string_types):<EOL><INDENT>r = TextReply(<EOL>message=message,<EOL>content=reply<EOL>)<EOL><DEDENT>elif isinstance(reply, (tuple, list)):<EOL><INDENT>if len(reply) > <NUM_LIT:10>:<EOL><INDENT>raise AttributeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>r = ArticlesReply(<EOL>message=message,<EOL>articles=reply<EOL>)<EOL><DEDENT>if r and render:<EOL><INDENT>return r.render()<EOL><DEDENT>return r<EOL>
Create a reply quickly