Initialize the GitHub searcher Args: token: GitHub Personal Access Token, optional
(self, token: Optional[str] = None)
| 69 | |
| 70 | class GitHubSearcher: |
| 71 | def __init__(self, token: Optional[str] = None): |
| 72 | """ |
| 73 | Initialize the GitHub searcher |
| 74 | |
| 75 | Args: |
| 76 | token: GitHub Personal Access Token, optional |
| 77 | """ |
| 78 | self.session = requests.Session() |
| 79 | if token: |
| 80 | self.session.headers.update({ |
| 81 | 'Authorization': f'token {token}', |
| 82 | 'Accept': 'application/vnd.github.v3+json' |
| 83 | }) |
| 84 | self.session.headers.update({ |
| 85 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' |
| 86 | }) |
| 87 | |
| 88 | # def search_code(self, |
| 89 | # repo_owner: str, |
nothing calls this directly
no outgoing calls
no test coverage detected