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))
// 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 param_name, subcl_params in config_params.items():
if isinstance(subcl_params, dict):
try:
subcl_name = 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:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
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: wkentaro/labelme
Commit Name: 7ad8d5c5cf89269d191117c4dd41ce205bc66c8c
Time: 2019-05-15
Author: www.kentaro.wada@gmail.com
File Name: labelme/widgets/label_dialog.py
Class Name: LabelDialog
Method Name: resetFlags
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__