(raw_value: Any)
| 191 | |
| 192 | |
| 193 | def parse_string_list(raw_value: Any) -> List[str]: |
| 194 | if raw_value in (None, "", []): |
| 195 | return [] |
| 196 | if isinstance(raw_value, list): |
| 197 | return [str(item).strip() for item in raw_value if str(item).strip()] |
| 198 | if isinstance(raw_value, dict): |
| 199 | return [str(key).strip() for key in raw_value.keys() if str(key).strip()] |
| 200 | if isinstance(raw_value, str): |
| 201 | try: |
| 202 | parsed = json.loads(raw_value) |
| 203 | except json.JSONDecodeError: |
| 204 | parsed = None |
| 205 | if isinstance(parsed, (list, dict)): |
| 206 | return parse_string_list(parsed) |
| 207 | return [item.strip() for item in re.split(r"[,;|\s]+", raw_value) if item.strip()] |
| 208 | return [str(raw_value).strip()] if str(raw_value).strip() else [] |
| 209 | |
| 210 | |
| 211 | def normalize_phrase_text(value: Any) -> str: |
no outgoing calls
no test coverage detected