def _to_json(self, resp):
        """
            Extract json from a response.
            Assumes response is valid otherwise.
            Internal use only.
        """
        try:
            json = resp.json()
        except __HOLE__ as e:
            reason = "TMC Server did not send valid JSON: {0}"
            raise APIError(reason.format(repr(e)))

        return json
dataset/ETHPy150Open JuhaniImberg/tmc.py/tmc/api.py/API._to_json