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

Function extract_code_names

Scripts/Network Tools/Store Scrapper.py:512–523  ·  view source on GitHub ↗
(text: Any, limit: int = 80)

Source from the content-addressed store, hash-verified

510
511
512def extract_code_names(text: Any, limit: int = 80) -> List[str]:
513 raw = clean_text(text).upper()
514 if not raw:
515 return []
516 found = []
517 for match in re.finditer(r"\b[A-Z]{1,4}-\d{1,3}(?:[A-Z]{1,2}|-\d{1,3}(?:-[A-Z0-9]{1,8})?)?\b", raw):
518 code = match.group(0).strip()
519 if looks_like_code_product_name(code):
520 found.append(code)
521 if len(found) >= limit:
522 break
523 return unique_keep_order(found)
524
525
526def extract_price_text_from_any(value: Any) -> str:

Calls 3

clean_textFunction · 0.70
unique_keep_orderFunction · 0.70

Tested by

no test coverage detected