@classmethod
    def from_json(cls, json_doc):
        """Parses the JSON document `json_doc` and returns a STIX
        :class:`Entity` implementation instance.

        Arguments:
            json_doc: Input JSON representation of a STIX entity. This can be
                a readable object or a JSON string.

        Returns:
            An implementation of :class:`.Entity` (e.g.,
            :class:`.STIXPackage`).

        """
        try:
            d = json.load(json_doc)
        except __HOLE__:  # catch the read() error
            d = json.loads(json_doc)

        return cls.from_dict(d)
dataset/ETHPy150Open STIXProject/python-stix/stix/base.py/Entity.from_json