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

Function verify_security_answers

Scripts/ButSystem.py:11098–11122  ·  view source on GitHub ↗

verify_security_answers. Internal helper function. This docstring was added automatically to improve maintainability. Args: username: Parameter. answers: Parameter. Returns: Varies.

(username: str, answers: dict)

Source from the content-addressed store, hash-verified

11096
11097 return feeds
11098
11099def _norm_space(s: str) -> str:
11100 return re.sub(r"\s+", " ", (s or "")).strip()
11101
11102def _parse_rss_items(xml_bytes: bytes, source: str, topic_key: str, topic_label: str, is_google: bool) -> List[Dict[str, str]]:
11103 """Parse RSS/Atom bytes into a list of items: {title,url,source,topic_key,topic,published}."""
11104 out: List[Dict[str, str]] = []
11105 try:
11106 import xml.etree.ElementTree as ET
11107 root = ET.fromstring(xml_bytes)
11108 except Exception:
11109 return out
11110
11111 def txt(el):
11112 if el is None:
11113 return ""
11114 return _norm_space("".join(el.itertext()))
11115
11116 def norm_title(t: str) -> Tuple[str, str]:
11117 """For Google News RSS, try to split 'Title - Publisher'."""
11118 if not is_google:
11119 return t, source
11120 t = (t or "").strip()
11121 if " - " in t:
11122 a, b = t.rsplit(" - ", 1)
11123 if a.strip() and b.strip():
11124 return a.strip(), b.strip()
11125 return t, source

Callers 2

two_factorFunction · 0.70
recoverFunction · 0.70

Calls 2

db_connectFunction · 0.70
_norm_answerFunction · 0.70

Tested by

no test coverage detected