Keep the first occurrence of each non-empty string.
(items: List[str])
| 524 | |
| 525 | |
| 526 | def dedupe_preserve_order(items: List[str]) -> List[str]: |
| 527 | """Keep the first occurrence of each non-empty string.""" |
| 528 | seen = set() |
| 529 | result = [] |
| 530 | for item in items: |
| 531 | normalized = str(item or "").strip() |
| 532 | if not normalized or normalized in seen: |
| 533 | continue |
| 534 | seen.add(normalized) |
| 535 | result.append(normalized) |
| 536 | return result |
| 537 | |
| 538 | |
| 539 | def estimate_quality_score(paper: Dict) -> float: |
no outgoing calls
no test coverage detected