(name: Any)
| 488 | |
| 489 | |
| 490 | def looks_like_code_product_name(name: Any) -> bool: |
| 491 | text = clean_text(name).strip().upper() |
| 492 | if not text or len(text) > 24: |
| 493 | return False |
| 494 | if not CODE_PRODUCT_NAME_RE.fullmatch(text): |
| 495 | return False |
| 496 | prefix = text.split("-", 1)[0] |
| 497 | if prefix in {"BLACK", "WHITE", "GRAY", "GREY", "RED", "BLUE", "GREEN", "BROWN", "BEIGE", "TAN", "PINK", "YELLOW", "ORANGE", "PURPLE", "SILVER", "GOLD", "CLEAR", "CHROME"}: |
| 498 | return False |
| 499 | return True |
| 500 | |
| 501 | |
| 502 | def normalize_product_slug(value: Any) -> str: |
no test coverage detected