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

Method create_from_raw_data

github/MainClass.py:983–1001  ·  view source on GitHub ↗

Creates an object from raw_data previously obtained by :attr:`GithubObject.raw_data`, and optionally headers previously obtained by :attr:`GithubObject.raw_headers`. :param klass: the class of the object to create :param raw_data: dict :param headers: dict

(
        self, klass: type[TGithubObject], raw_data: dict[str, Any], headers: dict[str, str | int] | None = None
    )

Source from the content-addressed store, hash-verified

981 return attributes
982
983 def create_from_raw_data(
984 self, klass: type[TGithubObject], raw_data: dict[str, Any], headers: dict[str, str | int] | None = None
985 ) -> TGithubObject:
986 """
987 Creates an object from raw_data previously obtained by :attr:`GithubObject.raw_data`, and optionally headers
988 previously obtained by :attr:`GithubObject.raw_headers`.
989
990 :param klass: the class of the object to create
991 :param raw_data: dict
992 :param headers: dict
993 :rtype: instance of class ``klass``
994
995 """
996 if headers is None:
997 headers = {}
998
999 if issubclass(klass, CompletableGithubObject):
1000 return klass(self.__requester, headers, raw_data, completed=True) # type: ignore
1001 return klass(self.__requester, headers, raw_data)
1002
1003 def dump(self, obj: GithubObject, file: BinaryIO, protocol: int = 0) -> None:
1004 """

Callers 2

loadMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected