(value: Any)
| 46 | |
| 47 | |
| 48 | def normalize_direction_key(value: Any) -> str: |
| 49 | raw = str(value or "").strip().casefold() |
| 50 | if not raw: |
| 51 | return "" |
| 52 | slug = re.sub(r"[^\w\u4e00-\u9fff]+", "-", raw, flags=re.UNICODE) |
| 53 | slug = slug.strip("-_") |
| 54 | slug = re.sub(r"[_\s]+", "-", slug) |
| 55 | slug = re.sub(r"-{2,}", "-", slug) |
| 56 | return slug |
| 57 | |
| 58 | |
| 59 | def _dedupe_strings(values: Iterable[Any]) -> List[str]: |
no outgoing calls
no test coverage detected