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

Method _useAttributes

github/GistComment.py:137–157  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

135 self._set_complete()
136
137 def _useAttributes(self, attributes: dict[str, Any]) -> None:
138 if "author_association" in attributes: # pragma no branch
139 self._author_association = self._makeStringAttribute(attributes["author_association"])
140 if "body" in attributes: # pragma no branch
141 self._body = self._makeStringAttribute(attributes["body"])
142 if "created_at" in attributes: # pragma no branch
143 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
144 if "id" in attributes: # pragma no branch
145 self._id = self._makeIntAttribute(attributes["id"])
146 elif "url" in attributes and attributes["url"]:
147 id = attributes["url"].split("/")[-1]
148 if id.isnumeric():
149 self._id = self._makeIntAttribute(int(id))
150 if "node_id" in attributes: # pragma no branch
151 self._node_id = self._makeStringAttribute(attributes["node_id"])
152 if "updated_at" in attributes: # pragma no branch
153 self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
154 if "url" in attributes: # pragma no branch
155 self._url = self._makeStringAttribute(attributes["url"])
156 if "user" in attributes: # pragma no branch
157 self._user = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["user"])

Callers 1

editMethod · 0.95

Calls 4

_makeStringAttributeMethod · 0.80
_makeIntAttributeMethod · 0.80
_makeClassAttributeMethod · 0.80

Tested by

no test coverage detected