bb6b2d059ad7b8a231d9f8015b41e60f033eaf76,studio/model.py,,get_config,#Any#,595

Before Change



    if config_file:
        with open(config_file) as f:
            config = yaml.load(f.read())
    else:
        def_config_file = os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            "default_config.yaml")

After Change



def get_config(config_file=None):

    config_paths = []
    if config_file:
        config_paths.append(os.expanduser(config_file))
    
    config_paths.append(os.path.expanduser("~/.tfstudio/config.yaml"))
    config_paths.append(
            os.path.join(
            os.path.dirname(os.path.realpath(__file__)),
            "default_config.yaml"))

    for path in config_paths:
        if not os.path.exists(path):
            continue
        
        with(open(path)) as f:
            return yaml.load(f.read())

    raise ValueError("None of the config paths {} exits!"
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


Project Name: studioml/studio
Commit Name: bb6b2d059ad7b8a231d9f8015b41e60f033eaf76
Time: 2017-08-04
Author: peter.zhokhov@sentient.ai
File Name: studio/model.py
Class Name:
Method Name: get_config


Project Name: adobe/NLP-Cube
Commit Name: e7f917e699e1ae92ed5342ca2a2318cf23cd691f
Time: 2019-01-11
Author: dumitrescu.stefan@gmail.com
File Name: cube/io_utils/model_store.py
Class Name: ModelStore
Method Name: delete_model


Project Name: NeuromorphicProcessorProject/snn_toolbox
Commit Name: b5302f4895953e33b2aadf4fef8fd1860f8f3625
Time: 2017-06-15
Author: bodo.rueckauer@gmail.com
File Name: snntoolbox/core/util.py
Class Name:
Method Name: normalize_parameters


Project Name: rlworkgroup/garage
Commit Name: aef210dd525d1651fc5966033b91760fe1a126fc
Time: 2020-04-29
Author: ahtsans@gmail.com
File Name: src/garage/tf/models/base.py
Class Name: Model
Method Name: parameters