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

Method _useAttributes

github/Milestone.py:213–249  ·  view source on GitHub ↗
(self, attributes: dict[str, Any])

Source from the content-addressed store, hash-verified

211 return PaginatedList(github.Label.Label, self._requester, f"{self.url}/labels", None)
212
213 def _useAttributes(self, attributes: dict[str, Any]) -> None:
214 if "closed_at" in attributes: # pragma no branch
215 self._closed_at = self._makeDatetimeAttribute(attributes["closed_at"])
216 if "closed_issues" in attributes: # pragma no branch
217 self._closed_issues = self._makeIntAttribute(attributes["closed_issues"])
218 if "created_at" in attributes: # pragma no branch
219 self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
220 if "creator" in attributes: # pragma no branch
221 self._creator = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["creator"])
222 if "description" in attributes: # pragma no branch
223 self._description = self._makeStringAttribute(attributes["description"])
224 if "due_on" in attributes: # pragma no branch
225 self._due_on = self._makeDatetimeAttribute(attributes["due_on"])
226 if "html_url" in attributes: # pragma no branch
227 self._html_url = self._makeStringAttribute(attributes["html_url"])
228 if "id" in attributes: # pragma no branch
229 self._id = self._makeIntAttribute(attributes["id"])
230 if "labels_url" in attributes: # pragma no branch
231 self._labels_url = self._makeStringAttribute(attributes["labels_url"])
232 if "node_id" in attributes: # pragma no branch
233 self._node_id = self._makeStringAttribute(attributes["node_id"])
234 if "number" in attributes: # pragma no branch
235 self._number = self._makeIntAttribute(attributes["number"])
236 elif "url" in attributes and attributes["url"]:
237 number = attributes["url"].split("/")[-1]
238 if number.isnumeric():
239 self._number = self._makeIntAttribute(int(number))
240 if "open_issues" in attributes: # pragma no branch
241 self._open_issues = self._makeIntAttribute(attributes["open_issues"])
242 if "state" in attributes: # pragma no branch
243 self._state = self._makeStringAttribute(attributes["state"])
244 if "title" in attributes: # pragma no branch
245 self._title = self._makeStringAttribute(attributes["title"])
246 if "updated_at" in attributes: # pragma no branch
247 self._updated_at = self._makeDatetimeAttribute(attributes["updated_at"])
248 if "url" in attributes: # pragma no branch
249 self._url = self._makeStringAttribute(attributes["url"])

Callers 1

editMethod · 0.95

Calls 4

_makeIntAttributeMethod · 0.80
_makeClassAttributeMethod · 0.80
_makeStringAttributeMethod · 0.80

Tested by

no test coverage detected