MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _extract_first_group

Function _extract_first_group

agents/coldstart-agent/main.py:597–605  ·  view source on GitHub ↗

Return the first non-empty capture group for a regex search.

(pattern: str, text: str)

Source from the content-addressed store, hash-verified

595 network and understand the implication.
596 """
597 if str(os.environ.get("PAPERFLOW_ALLOW_PRIVATE_FETCH", "")).strip().lower() in {"1", "true", "yes", "on"}:
598 return
599
600 parts = urlsplit(url)
601 if parts.scheme not in {"http", "https"}:
602 raise ValueError(f"unsupported URL scheme for fetching: {parts.scheme or '(none)'}")
603
604 hostname = parts.hostname
605 if not hostname:
606 raise ValueError("URL has no host to fetch")
607
608 try:

Calls

no outgoing calls

Tested by

no test coverage detected