b7e8d7d7fb49ae7a66fce7e6ee1f0cbaf561e7d6,mmcv/utils/registry.py,,build_from_cfg,#Any#Any#Any#,88
Before Change
if not (isinstance(default_args, dict) or default_args is None):
raise TypeError(
"default_args must be a dict or None, but got {}".format(
type(default_args) ))
args = cfg.copy()
obj_type = args.pop("type")
After Change
if is_str(obj_type):
obj_cls = registry.get(obj_type)
if obj_cls is None:
raise KeyError(
f"{obj_type} is not in the {registry.name} registry")
elif inspect.isclass(obj_type):
obj_cls = obj_type
else:
raise TypeError(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: open-mmlab/mmcv
Commit Name: b7e8d7d7fb49ae7a66fce7e6ee1f0cbaf561e7d6
Time: 2020-04-25
Author: yhcao6@gmail.com
File Name: mmcv/utils/registry.py
Class Name:
Method Name: build_from_cfg
Project Name: oddt/oddt
Commit Name: dfc44c3f01c3075fbf6d29593339683420127aa4
Time: 2017-12-11
Author: marta-sd@users.noreply.github.com
File Name: oddt/datasets.py
Class Name: pdbbind
Method Name: __getitem__
Project Name: open-mmlab/mmcv
Commit Name: b7e8d7d7fb49ae7a66fce7e6ee1f0cbaf561e7d6
Time: 2020-04-25
Author: yhcao6@gmail.com
File Name: mmcv/utils/registry.py
Class Name: Registry
Method Name: _register_module