MCPcopy Create free account
hub / github.com/NVIDIA-NeMo/Switchyard / _require_mapping

Function _require_mapping

switchyard/cli/route_bundle.py:1304–1312  ·  view source on GitHub ↗
(value: object, where: str)

Source from the content-addressed store, hash-verified

1302
1303
1304def _require_mapping(value: object, where: str) -> dict[str, object]:
1305 if not isinstance(value, Mapping):
1306 raise RouteBundleConfigError(f"{where} must be a mapping")
1307 result: dict[str, object] = {}
1308 for key, item in value.items():
1309 if not isinstance(key, str):
1310 raise RouteBundleConfigError(f"{where} keys must be strings")
1311 result[key] = item
1312 return result
1313
1314
1315def _optional_mapping(value: object, where: str) -> dict[str, object]:

Callers 7

_classifier_mappingFunction · 0.85
_target_mappingFunction · 0.85
_target_defaultsFunction · 0.85
_normalize_routeFunction · 0.85
_validate_route_keysFunction · 0.85
_optional_mappingFunction · 0.85

Calls 2

itemsMethod · 0.80

Tested by

no test coverage detected