9b8d5f3516b68250c0e43d348e7ec88abfb3fa13,docs/source/generate_zoo_list.py,,,#,11

Before Change


    fout.write("\n\n")

    fout.write("Example invocation:\n\n")
    fout.write(
        ".. code-block:: shell\n\n"
        "  python -m parlai.scripts.eval_model --model {} --task {} -mf {}\n\n"
        .format(
            model["agent"],
            model["task"],
            model["path"],
        )
    )
    fout.write("\n")

fout.close()

After Change



    fout.write("Example invocation:\n\n")
    if "example" in model:
        example = model["example"]
    else:
        example = (
            "python -m parlai.scripts.eval_model --model {} --task {} -mf {}"
            .format(model["agent"], model["task"], model["path"])
        )
    result = model["result"].strip().split("\n")
    // strip leading whitespace from results
    result = [r.strip() for r in result]
    // make sure we indent for markdown though
    result = ["   " + r for r in result]
    result = "\n".join(result)
    fout.write(
        ".. code-block:: shell\n\n   {}\n   ...\n{}\n\n"
        .format(example, result)
    )
    fout.write("\n")

fout.close()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: facebookresearch/ParlAI
Commit Name: 9b8d5f3516b68250c0e43d348e7ec88abfb3fa13
Time: 2018-10-30
Author: roller@fb.com
File Name: docs/source/generate_zoo_list.py
Class Name:
Method Name:


Project Name: senarvi/theanolm
Commit Name: 91184b6bdcdbce3a37cc91a54801b98356910849
Time: 2015-11-22
Author: seppo.git@marjaniemi.com
File Name: theanolm/commands/score.py
Class Name:
Method Name: _score_text


Project Name: senarvi/theanolm
Commit Name: b7453958eda963b0a2bc83472731adaa76ee4d11
Time: 2015-12-11
Author: seppo.git@marjaniemi.com
File Name: theanolm/commands/score.py
Class Name:
Method Name: _score_text