MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / get_content

Method get_content

github/GithubRetry.py:211–228  ·  view source on GitHub ↗
(resp: HTTPResponse, url: str)

Source from the content-addressed store, hash-verified

209
210 @staticmethod
211 def get_content(resp: HTTPResponse, url: str) -> bytes: # type: ignore[override]
212 # logic taken from HTTPAdapter.build_response (requests.adapters)
213 response = Response()
214
215 # Fallback to None if there's no status_code, for whatever reason.
216 response.status_code = getattr(resp, "status", None) # type: ignore
217
218 # Make headers case-insensitive.
219 response.headers = CaseInsensitiveDict(getattr(resp, "headers", {}))
220
221 # Set encoding.
222 response.encoding = get_encoding_from_headers(response.headers)
223 response.raw = resp
224 response.reason = response.raw.reason # type: ignore
225
226 response.url = url
227
228 return response.content
229
230 def __log(self, level: int, message: str, **kwargs: Any) -> None:
231 if self.__logger is None:

Callers 1

incrementMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected