def create_reply(comment):
    """Search comments for username mentions followed by code blocks
    and return a formatted reply containing the output of the executed
    block or a message with additional information.
    """
    try:
        args, src, stdin = parse_comment(comment.body)
    except AttributeError:
        preamble = ERROR_PREAMBLE.format(link=comment.permalink)
        postamble = ERROR_POSTAMBLE.format(link=comment.permalink)
        error_text = preamble + FORMAT_ERROR_TEXT + postamble
        log("Formatting error on comment {c.permalink}".format(
            c=comment))
        return MessageReply(error_text)
    # Seperate the language name from the rest of the supplied options.
    try:
        lang, opts = args.split(' -', 1)
        opts = ('-' + opts).split()
    except ValueError:
        # No additional opts found
        lang, opts = args, []
    lang = lang.strip()
    try:
        details = compile(src, lang, stdin=stdin)
        log("Compiled ideone submission {link} for comment {id}".format(
            link=details['link'], id=comment.id))
    except ideone.LanguageNotFoundError as e:
        preamble = ERROR_PREAMBLE.format(link=comment.permalink)
        postamble = ERROR_POSTAMBLE.format(link=comment.permalink)
        choices = ', '.join(e.similar_languages)
        error_text = LANG_ERROR_TEXT.format(lang=lang, choices=choices)
        error_text = preamble + error_text + postamble
        # TODO Add link to accepted languages to msg
        log("Language error on comment {id}".format(id=comment.id))
        return MessageReply(error_text)
    # The ideone submission result value indicaties the final state of
    # the program. If the program compiled and ran successfully the
    # result is 15. Other codes indicate various errors.
    result_code = details['result']
    # The user is alerted of any errors via message reply unless they
    # include an option to include errors in the reply.
    if result_code == 15 or (opts in '--include-errors' and result_code in [11, 12]):
        text = format_reply(details, opts)
        ideone_link = "http://ideone.com/{}".format(details['link'])
        url_pl = urllib.quote(comment.permalink)
        text += FOOTER.format(ide_link=ideone_link, perm_link=url_pl)
    else:
        log("Result error {code} detected in comment {id}".format(
            code=result_code, id=comment.id))
        preamble = ERROR_PREAMBLE.format(link=comment.permalink)
        postamble = ERROR_POSTAMBLE.format(link=comment.permalink)
        error_text = {
            11: COMPILE_ERROR_TEXT,
            12: RUNTIME_ERROR_TEXT,
            13: TIMEOUT_ERROR_TEXT,
            17: MEMORY_ERROR_TEXT,
            19: ILLEGAL_ERROR_TEXT,
            20: INTERNAL_ERROR_TEXT
        }.get(result_code, '')
        # Include any output from the submission in the reply.
        if details['cmpinfo']:
            error_text += "Compiler Output:\n\n{}\n\n".format(
                                code_block(details['cmpinfo']))
        if details['output']:
            error_text += "Output:\n\n{}\n\n".format(
                    code_block(details['output']))
        if details['stderr']:
            error_text += "Error Output:\n\n{}\n\n".format(
                                code_block(details['stderr']))
        error_text = preamble + error_text + postamble
        return MessageReply(error_text)
    return CompiledReply(text, details)
dataset/ETHPy150Open renfredxh/compilebot/compilebot/compilebot.py/create_reply/swapped operands of `in`