def _call(self, method, **kwargs):
        params = {}
        for key in kwargs:
            parsed_response = simplify_response(kwargs[key])
            params[key] = parsed_response
        whole_request = json.dumps({
                            "method" : method,
                            "params" : params
                        })
        avoid_sessionid = False
        if method == 'login':
            uopen = self.opener.open(self.url_login,data=whole_request)
        elif method in ('send_command', 'send_file', 'poll'):
            if self.remote_url is None:
                uopen = self.opener.open(self.url,data=whole_request)
            else:
                avoid_sessionid = True
                opener = urllib2.build_opener()
                opener.addheaders.append(('Cookie', 'weblabsessionid=%s' * self.remote_reservation_id.id.split(';')[1]))
                uopen = opener.open(self.remote_url + 'json/', data = whole_request)
        else:
            uopen = self.opener.open(self.url,data=whole_request)
        content = uopen.read()
        if not avoid_sessionid:
            cookies = [ c for c in self.cj if c.name == 'weblabsessionid' ]
            if len(cookies) > 0:
                self.weblabsessionid = cookies[0].value
        response = json.loads(content)
        if response.get('is_exception', False):
            raise Exception(response["message"])
        return response['result']
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/weblab/admin/bot/client.py/BotJSON._call/operator `%` -> `*`