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

Method _to_github_dict

github/AdvisoryCredit.py:104–121  ·  view source on GitHub ↗
(credit: Credit)

Source from the content-addressed store, hash-verified

102
103 @staticmethod
104 def _to_github_dict(credit: Credit) -> SimpleCredit:
105 assert isinstance(credit, (dict, AdvisoryCredit)), credit
106 if isinstance(credit, dict):
107 assert "login" in credit, credit
108 assert "type" in credit, credit
109 assert isinstance(credit["login"], (str, github.NamedUser.NamedUser)), credit["login"]
110 login = credit["login"]
111 if isinstance(login, github.NamedUser.NamedUser):
112 login = login.login
113 return {
114 "login": login,
115 "type": credit["type"],
116 }
117 else:
118 return {
119 "login": credit.login,
120 "type": credit.type,
121 }
122
123 def _useAttributes(self, attributes: dict[str, Any]) -> None:
124 if "login" in attributes: # pragma no branch

Callers 4

add_vulnerabilitiesMethod · 0.45
offer_creditsMethod · 0.45
editMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected