MCPcopy Create free account
hub / github.com/mlco2/codecarbon / _is_github_host

Function _is_github_host

scripts/check_docs_links.py:45–48  ·  view source on GitHub ↗

True if URL host is github.com or a subdomain (not e.g. evilgithub.com).

(url: str)

Source from the content-addressed store, hash-verified

43
44
45def _is_github_host(url: str) -> bool:
46 """True if URL host is github.com or a subdomain (not e.g. evilgithub.com)."""
47 host = (urllib.parse.urlparse(url).hostname or "").lower()
48 return host == "github.com" or host.endswith(".github.com")
49
50
51def _matches_glob(url: str, pattern: str) -> bool:

Callers 1

_check_externalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…