MCPcopy Create free account
hub / github.com/BrainCoTech/RevoLab / _get_cfg_value

Function _get_cfg_value

scripts/hora/export_onnx.py:92–104  ·  view source on GitHub ↗
(cfg: Any | None, key_path: str, default: Any)

Source from the content-addressed store, hash-verified

90
91
92def _get_cfg_value(cfg: Any | None, key_path: str, default: Any) -> Any:
93 if cfg is None:
94 return default
95 node: Any = cfg
96 for key in key_path.split("."):
97 if isinstance(node, dict) and key in node:
98 node = node[key]
99 continue
100 if hasattr(node, key):
101 node = getattr(node, key)
102 continue
103 return default
104 return node
105
106
107def _build_net_config(cfg: Any | None, stage: str, obs_dim: int, actions_num: int) -> dict[str, Any]:

Callers 2

_build_net_configFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected