f31b7ad689b1435e76744af4ff443607643a37fd,studio/experiment.py,,create_experiment,#Any#Any#Any#Any#Any#Any#Any#Any#,116

Before Change


        if pkg._key == "studioml":
            continue

        if resources_needed is not None and \
           int(resources_needed.get("gpus")) > 0 and \
           (pkg._key == "tensorflow" or pkg._key == "tf-nightly"):
            packages.insert(0, pkg._key + "-gpu==" + pkg._version)
            packages.insert(0, pkg._key + "==" + pkg._version)

        elif pkg._key == "tensorflow-gpu" or pkg._key == "tf-nightly-gpu":
            packages.insert(0, pkg._key[:-4] + "==" + pkg._version)
        else:
            packages.append(pkg._key + "==" + pkg._version)

    return Experiment(
        key=key,
        filename=filename,
        args=args,

After Change


    freeze_output = [p for p in pip.operations.freeze.freeze()]
    for pkg in pip.operations.freeze.freeze():

        if pkg.startswith("-e git+"):
            // git package
            packages.append(pkg)
        elif "==" in pkg:
            // pypi package
            key = re.search(r"^.*?(?=\=\=)", pkg).group(0)
            version = re.search(r"(?<=\=\=).*\Z", pkg).group(0)

            if resources_needed is not None and \
                    int(resources_needed.get("gpus")) > 0:
                if (key == "tensorflow" or key == "tf-nightly"):
                    key = key + "-gpu"

            // TODO add installation logic for torch
            packages.append(key + "==" + version)

    return Experiment(
        key=key,
        filename=filename,
        args=args,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: studioml/studio
Commit Name: f31b7ad689b1435e76744af4ff443607643a37fd
Time: 2017-12-28
Author: peter.zhokhov@sentient.ai
File Name: studio/experiment.py
Class Name:
Method Name: create_experiment


Project Name: alfredfrancis/ai-chatbot-framework
Commit Name: f00bbc9ca76a4a1fd9ddc46954a76237ecd4c616
Time: 2016-05-21
Author: alfred.francis@pearldatadirect.com
File Name: iky_server/try.py
Class Name:
Method Name: extract_chunks


Project Name: pantsbuild/pants
Commit Name: 319d55448cf4f3bd86fc56987a495f2e2858dc62
Time: 2016-03-31
Author: benjyw@gmail.com
File Name: src/python/pants/option/parser.py
Class Name: Parser
Method Name: parse_args