INNER CODE UNIT · Python

repo_identifier

epigen/MrBiomics · helpers/MrBiomics_context_crawler.py:90

def repo_identifier(repo_url: str) -> str:
  parsed = urlparse(repo_url)
  path = parsed.path.strip("/")
  if path.endswith(".git"):
      path = path[:-4]
  return path


def github_headers(token: Optional[str]) -> dict[str, str]:
  headers = {
      "Accept": "application/vnd.github+json",
      "User-Agent": "MrBiomics-context-crawler",
  }
  if token:
      headers["Authorization"] = f"Bearer {token}"
  return headers

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…