MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / parse_authors

Function parse_authors

experiments/baselines/scholar_inbox/runner.py:102–117  ·  view source on GitHub ↗
(raw_value: Any)

Source from the content-addressed store, hash-verified

100
101
102def parse_authors(raw_value: Any) -> List[str]:
103 if raw_value in (None, "", []):
104 return []
105 if isinstance(raw_value, list):
106 return [str(item).strip() for item in raw_value if str(item).strip()]
107 if isinstance(raw_value, str):
108 try:
109 parsed = json.loads(raw_value)
110 except json.JSONDecodeError:
111 parsed = None
112 if isinstance(parsed, list):
113 return [str(item).strip() for item in parsed if str(item).strip()]
114 if parsed is not None:
115 return [str(parsed).strip()]
116 return [item.strip() for item in raw_value.split(",") if item.strip()]
117 return [str(raw_value).strip()] if str(raw_value).strip() else []
118
119
120def parse_string_list(raw_value: Any) -> List[str]:

Callers 1

author_match_scoreFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected