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

Before Change




def from_params(cls: Type, params: Dict, **kwargs) -> Type:
    signature_params = getfullargspec(cls.__init__).args[1:]
    config_params = {}
    for sp in signature_params:
        try:
            config_params[sp] = params[sp]
        except KeyError:
            // Occurs when params[sp] throws KeyError. It means that the needed configuration is
            // absent in the json file and a default configuration from class constructor should
            // be taken instead.
            pass

    for reg_name, subcl_params in config_params.items():
        if isinstance(subcl_params, dict):
            try:
                subcl = _REGISTRY[subcl_params["name"]]

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

Frequency: 3

Non-data size: 11

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: 9e4d759bc80f48fde5ebd34d011895d51528e424
Time: 2017-12-18
Author: dilyara.rimovna@gmail.com
File Name: deeppavlov/core/common/params.py
Class Name:
Method Name: from_params


Project Name: deepmipt/DeepPavlov
Commit Name: 3e6d5a72b03f7a17bdaf5967e337db077c89df41
Time: 2018-01-22
Author: arkhipov@yahoo.com
File Name: deeppavlov/models/ner/ner.py
Class Name: NER
Method Name: __init__


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