0540ba000c084f43b51f46d0b61be79df6e82570,deeppavlov/core/common/params.py,,from_params,#Any#Any#,9

Before Change



def from_params(cls: Type, params: Dict, **kwargs) -> Type["T"]:
    config_params = {}
    for sp in params.keys():
        try:
            if sp != "name":
                config_params[sp] = params[sp]
        except KeyError:
            print("Using default value for parameter `{}`.".format(sp))

After Change




def from_params(cls: Type, params: Dict, **kwargs) -> Type["T"]:
    config_params = {k: v for k, v in params.items() if k != "name"}

    for param_name, subcl_params in config_params.items():
        if isinstance(subcl_params, dict):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: 0540ba000c084f43b51f46d0b61be79df6e82570
Time: 2017-12-15
Author: ol.gure@gmail.com
File Name: deeppavlov/core/common/params.py
Class Name:
Method Name: from_params


Project Name: dmlc/gluon-nlp
Commit Name: b1b61d3f90cf795c7b48b6d109db7b7b96fa21ff
Time: 2019-08-04
Author: lausen@amazon.com
File Name: src/gluonnlp/model/attention_cell.py
Class Name: MultiHeadAttentionCell
Method Name: __init__


Project Name: ray-project/ray
Commit Name: 1d532d1cb8b829bdf7055a22c206032ca0b72e46
Time: 2020-04-02
Author: rkooo567@gmail.com
File Name: python/ray/dashboard/metrics_exporter/schema.py
Class Name: BaseModel
Method Name: parse_obj