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

Function _dedupe_string_list

scripts/common.py:141–150  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

139
140
141def _dedupe_string_list(value: Any) -> list[str]:
142 if value in ("", None, [], {}):
143 return []
144 values = value if isinstance(value, list) else [value]
145 deduped: list[str] = []
146 for item in values:
147 cleaned = normalize_whitespace(str(item))
148 if cleaned and cleaned not in deduped:
149 deduped.append(cleaned)
150 return deduped
151
152
153def _append_reason(reasons: list[str], reason: str) -> None:

Callers 1

Calls 1

normalize_whitespaceFunction · 0.85

Tested by

no test coverage detected