def load(self, bytes, base_url=None):
        try:
            data = json.loads(bytes.decode('utf-8'))
        except ValueError as exc:
            raise ParseError('Malformed JSON. %s' % exc)

        doc = _primative_to_document(data, base_url)

        if isinstance(doc, Object):
            doc = Document(content=dict(doc))
        elif not (isinstance(doc, Document) or isinstance(doc, Error)):
            raise ParseError('Top level node should be a document or error.')

        return doc
Takes a bytestring and returns a document.
dataset/ETHPy150Open core-api/python-client/coreapi/codecs/corejson.py/CoreJSONCodec.load