MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / looks_like_code_product_name

Function looks_like_code_product_name

Scripts/Network Tools/Store Scrapper.py:490–499  ·  view source on GitHub ↗
(name: Any)

Source from the content-addressed store, hash-verified

488
489
490def 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
502def normalize_product_slug(value: Any) -> str:

Callers 5

extract_code_namesFunction · 0.85
walkFunction · 0.85
is_likely_product_urlFunction · 0.85

Calls 1

clean_textFunction · 0.70

Tested by

no test coverage detected