def __make_writer_request(<EOL>self,<EOL>params=None,<EOL>json=None,<EOL>http_method="<STR_LIT:POST>",<EOL>trace=False):
request = requests.Request(<EOL>http_method,<EOL>self.writer_url,<EOL>params=params,<EOL>json=json,<EOL>headers={<EOL>'<STR_LIT>': self.user_agent})<EOL>ids = id_gen(str(uuid.uuid4()))<EOL>network_timeouts = self.network_timeouts()<EOL>maintenance_timeouts = self.maintenance_timeouts()<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>response = self.__send_single_request(request, ids.next(), trace=trace)<EOL>return response<EOL><DEDENT>except (Timeout, ConnectionError, ProtocolError):<EOL><INDENT>logger.warn(traceback.format_exc())<EOL>try:<EOL><INDENT>timeout = next(network_timeouts)<EOL>logger.warn(<EOL>"<STR_LIT>" %<EOL>timeout)<EOL>time.sleep(timeout)<EOL>continue<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise self.NetworkError()<EOL><DEDENT><DEDENT>except self.UnderMaintenance as e:<EOL><INDENT>try:<EOL><INDENT>timeout = next(maintenance_timeouts)<EOL>logger.warn(<EOL>"<STR_LIT>" %<EOL>timeout)<EOL>time.sleep(timeout)<EOL>continue<EOL><DEDENT>except StopIteration:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT><DEDENT>
Send request to writer service.