def loads()

in elastic_transport/_serializer.py [0:0]


    def loads(self, data: bytes) -> Any:
        # Sometimes responses use Content-Type: json but actually
        # don't contain any data. We should return something instead
        # of erroring in these cases.
        if data == b"":
            return None

        try:
            return self.json_loads(data)
        except (ValueError, TypeError) as e:
            raise SerializationError(
                message=f"Unable to deserialize as JSON: {data!r}", errors=(e,)
            )