INNER CODE UNIT · Python

fetch_repo_digest

epigen/MrBiomics · helpers/MrBiomics_context_crawler.py:136

def fetch_repo_digest(repo: RepoSpec, token: Optional[str] = None) -> str:
  kwargs: dict[str, object] = {}
  if token:
      kwargs["token"] = token
  if repo.include_patterns:
      kwargs["include_patterns"] = list(repo.include_patterns)
  if repo.exclude_patterns:
      kwargs["exclude_patterns"] = list(repo.exclude_patterns)
  try:
      summary, tree, content = ingest(repo.url, **kwargs)
  except Exception as exc:
      warning = f"GitIngest failed for {repo.url}: {exc}"
      print(f"WARNING: {warning}", file=sys.stderr)
      return warning
  parts = []
  for part in (summary, tree, content):
      if part:
          parts.append(part.strip())

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…