MCPcopy Index your code
hub / github.com/SooLab/CGFormer / __init__

Method __init__

utils/config.py:16–24  ·  view source on GitHub ↗
(self, init_dict=None, key_list=None, new_allowed=False)

Source from the content-addressed store, hash-verified

14 dict-like container that allows for attribute-based access to keys.
15 """
16 def __init__(self, init_dict=None, key_list=None, new_allowed=False):
17 # Recursively convert nested dictionaries in init_dict into CfgNodes
18 init_dict = {} if init_dict is None else init_dict
19 key_list = [] if key_list is None else key_list
20 for k, v in init_dict.items():
21 if type(v) is dict:
22 # Convert dict to CfgNode
23 init_dict[k] = CfgNode(v, key_list=key_list + [k])
24 super(CfgNode, self).__init__(init_dict)
25
26 def __getattr__(self, name):
27 if name in self:

Callers

nothing calls this directly

Calls 2

CfgNodeClass · 0.85
itemsMethod · 0.80

Tested by

no test coverage detected