def list_issues(per_page: int):
  """
  Generator to list all issues for the repository by handling pagination.

  Args:
    per_page: number of pages to return per page.

  """
  state = "open"
  # only process the 1st page for testing for now
  page = 1
  results = []
  url = (  # :contentReference[oaicite:16]{index=16}
      f"{BASE_URL}/repos/{OWNER}/{REPO}/issues"
  )
  # Warning: let's only handle max 10 issues at a time to avoid bad results
  params = {"state": state, "per_page": per_page, "page": page}
  response = requests.get(url, headers=headers, params=params)
  response.raise_for_status()  # :contentReference[oaicite:17]{index=17}
  issues = response.json()
  if not issues:
    return []
  for issue in issues:
    # Skip pull requests (issues API returns PRs as well)
    if "pull_request" in issue:
      continue
    results.append(issue)
  return results

  Generator to list all issues for the repository by handling pagination.

  Args:
    per_page: number of pages to return per page.

  
contributing/samples/adk_triaging_agent/agent.py