MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / first_present

Function first_present

graphify/callflow_html.py:107–112  ·  view source on GitHub ↗

Return the first non-empty value for any candidate key.

(mapping: dict, *keys, default=None)

Source from the content-addressed store, hash-verified

105
106
107def first_present(mapping: dict, *keys, default=None):
108 """Return the first non-empty value for any candidate key."""
109 for key in keys:
110 if key in mapping and mapping[key] not in (None, ""):
111 return mapping[key]
112 return default
113
114
115def first_list(*values) -> list:

Callers 4

endpoint_idFunction · 0.85
normalize_nodeFunction · 0.85
normalize_edgeFunction · 0.85
load_labelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected