5041068ea241f946217690aee63942261911b42d,tasks.py,,build_docs,#Any#,33

Before Change


    dir_contents = ((set(dir_contents) - set(all_refs))
                    | (set(all_refs) - set(refs)))
    dir_contents -= set(["docs", ".git"])
    print("going to delete")
    for item in dir_contents:
        if os.path.isfile(item):
            print("deleting: " + item)
            os.remove(item)

After Change



    all_refs = c.run("git tag --list", hide="out").stdout.split("\n")
    all_refs = [tag for tag in all_refs if tag]
    all_refs = ALLOWED_BRANCHES + sorted(all_refs)

    if head_name == "master":
        refs = [r for r in all_refs]  // copy all_refs
    else:
        refs = [head_name]

    with c.cd("./docs/"):
        c.run("mkdir -p _static _templates")
        c.run("make clean", hide="out")

        build_dirs = []
        for ref in refs:
            c.run("git checkout " + ref)

            b_dir = "_build/html/{}".format(ref)
            build_dirs += b_dir
            version_str = ref
            release_str = ref
            c.run("QUCUMBER_VERSION={}; ".format(version_str)
                  + "QUCUMBER_RELEASE={}; ".format(release_str)
                  + "sphinx-build -b html ./ {} -aT".format(b_dir))

        if head_name == "master":
            c.run("touch _build/html/.nojekyll")
            c.run("mv _templates/index.html _build/html/index.html")
            with open("_build/html/versions.html", "wb") as f:
                f.write(versions_template.render(refs=refs))

    c.run("git checkout gh-pages")

    dir_contents = os.listdir()
    dir_contents = ((set(dir_contents) - set(all_refs))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: PIQuIL/QuCumber
Commit Name: 5041068ea241f946217690aee63942261911b42d
Time: 2018-08-07
Author: emerali@users.noreply.github.com
File Name: tasks.py
Class Name:
Method Name: build_docs


Project Name: deepchem/deepchem
Commit Name: c7c06f56e918cabf565d4e4454daa344137d1f0f
Time: 2017-05-25
Author: Karl
File Name: contrib/rl/tictactoe.py
Class Name:
Method Name: main


Project Name: philipperemy/keras-tcn
Commit Name: 0cfe82c6beb9a28a5ff7da81b86fa0e93c388f14
Time: 2019-11-20
Author: premy@cogent.co.jp
File Name: tasks/save_reload_model.py
Class Name:
Method Name:


Project Name: zake7749/PTT-Chat-Generator
Commit Name: 75c1231f77fc1ebc5af31d5c598f1353ea9aa5df
Time: 2016-10-20
Author: zake7749@gmail.com
File Name: filter.py
Class Name: ArticleFilter
Method Name: generate_corpus