MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / _normalize_domain_rule

Function _normalize_domain_rule

scripts/common.py:1322–1338  ·  view source on GitHub ↗
(raw: dict[str, Any])

Source from the content-addressed store, hash-verified

1320
1321
1322def _normalize_domain_rule(raw: dict[str, Any]) -> dict[str, Any] | None:
1323 label = str(raw.get("label", "")).strip()
1324 if not label:
1325 return None
1326 rule: dict[str, Any] = {"label": label}
1327 route_to = str(raw.get("route_to", "")).strip()
1328 if route_to:
1329 rule["route_to"] = route_to
1330 rule["aliases"] = _as_string_list(raw.get("aliases"))
1331 rule["specialized_folders"] = _as_string_list(raw.get("specialized_folders"))
1332 rule["keywords"] = _as_string_list(raw.get("keywords")) + _as_string_list(
1333 raw.get("application_keywords")
1334 )
1335 rule["methods"] = _as_string_list(raw.get("methods")) + _as_string_list(
1336 raw.get("method_keywords")
1337 )
1338 return rule
1339
1340
1341def _normalize_domain_rules(

Callers 1

_normalize_domain_rulesFunction · 0.85

Calls 1

_as_string_listFunction · 0.85

Tested by

no test coverage detected