MCPcopy Create free account
hub / github.com/OpenDCAI/Paper2Any / push

Function push

dataflow_agent/utils_paper_visuals.py:132–148  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

130 refs: list[str] = []
131
132 def push(value: Any) -> None:
133 if value is None:
134 return
135 if isinstance(value, dict):
136 for key in ("asset_ref", "assetRef", "src", "path", "storage_path", "storagePath", "ref"):
137 if key in value:
138 push(value.get(key))
139 return
140 return
141 if isinstance(value, list):
142 for item in value:
143 push(item)
144 return
145 for part in re.split(r"[,\n]+", str(value)):
146 ref = _normalize_ref(part)
147 if ref and ref.lower() not in {"null", "none", "n/a"} and ref not in refs:
148 refs.append(ref)
149
150 for key in ("asset_ref", "assetRef", "asset", "assets", "visual_assets", "visualAssets"):
151 push(page.get(key))

Callers 1

_extract_page_refsFunction · 0.70

Calls 2

_normalize_refFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected