def process_request(self, method, data=None):
<EOL>self._validate_request_method(method)<EOL>attempts = <NUM_LIT:3><EOL>for i in range(attempts):<EOL><INDENT>response = self._send_request(method, data)<EOL>if self._is_token_response(response):<EOL><INDENT>if i < attempts - <NUM_LIT:1>:<EOL><INDENT>time.sleep(<NUM_LIT:2>)<EOL>continue<EOL><DEDENT>else:<EOL><INDENT>raise UpdatingTokenResponse<EOL><DEDENT><DEDENT>break<EOL><DEDENT>resp = BaseResponse(response)<EOL>if response.headers.get('<STR_LIT>') == '<STR_LIT:application/json>':<EOL><INDENT>if not resp.json.get('<STR_LIT:status>'):<EOL><INDENT>if all([<EOL>resp.json.get('<STR_LIT>') == <NUM_LIT:1>,<EOL>resp.json.get('<STR_LIT>') == u"<STR_LIT>"<EOL>"<STR_LIT>",<EOL>]):<EOL><INDENT>raise MaintenanceResponse(response=resp.json)<EOL><DEDENT>else:<EOL><INDENT>raise ResponseError(response=resp.json)<EOL><DEDENT><DEDENT><DEDENT>return resp<EOL>
Process request over HTTP to ubersmith instance.

            method: Ubersmith API method string
            data: dict of method arguments