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

Before Change



    packages = []

    for i, pkg in enumerate(
            pip.pip.get_installed_distributions(local_only=True)):
        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



    packages = []
    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: 5

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: has2k1/plotnine
Commit Name: a3d56beaf95b4b4cff9b70af7312e0a3bdeb6e98
Time: 2017-11-21
Author: has2k1@gmail.com
File Name: plotnine/aes.py
Class Name:
Method Name: is_calculated_aes


Project Name: Rostlab/nalaf
Commit Name: 38031f27041ca74754bdbd773588ef43935d3307
Time: 2015-09-27
Author: carsten.uhlig@gmail.com
File Name: nala/bootstrapping/__init__.py
Class Name: Iteration
Method Name: __init__