def _json_response(self, result=None, error=None):
    response = {'jsonrpc': '2.0', 'id': self.id}
    if (error is not None):
        response['error'] = error
    if (result is not None):
        response['result'] = result
    return response
def _json_response(self, result=None, error=None):
    response = {'jsonrpc': '2.0', 'id': self.id}
    if (error is not None):
        response['error'] = error
    if (result is not None):
        response['result'] = result
    return response