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


        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"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: MolSSI/QCEngine
Commit Name: 4d4e0d81c5c36674228535fc372923c9391f247d
Time: 2019-06-28
Author: alolinco@iastate.edu
File Name: qcengine/programs/nwchem/harvester.py
Class Name:
Method Name: harvest_outfile_pass


Project Name: pandas-dev/pandas
Commit Name: 16c693a80b08af2e0f15f1a4d29e07d3eb5643cd
Time: 2020-11-18
Author: mohammed15035@iiitd.ac.in
File Name: scripts/check_for_inconsistent_pandas_namespace.py
Class Name:
Method Name: main