def _call(self, method, *params):
        body = {'jsonrpc': '2.0', 'method': method, 'params': params}
        if self.connection.xsrf_key:
            body['xsrfKey'] = self.connection.xsrf_key
        body = json.dumps(body)
        data = json.loads(self._request(self.url, body)[1])

        if 'error' in data:
            error = GerritError
            if data['error']['message'] == 'Not Signed In':
                error = NotSignedInError

            raise error(data['error']['message'])

        return data['result']
dataset/ETHPy150Open bcwaldon/python-gerrit/gerrit/service.py/Service._call/original