def execute(self, timeout=None):
logger.debug('<STR_LIT>' % len(self._commands))<EOL>auth = self._build_http_auth()<EOL>headers = self._build_request_headers()<EOL>logger.debug('<STR_LIT>' % headers)<EOL>logger.debug('<STR_LIT>' % len(self._commands))<EOL>path = self._build_request_path(self.BATCH_ENDPOINT)<EOL>data = json.dumps(self._commands, cls=self._json_encoder)<EOL>r = requests.post(<EOL>path,<EOL>auth=auth,<EOL>headers=headers,<EOL>data=data,<EOL>timeout=(self.DEFAULT_TIMEOUT if timeout is None else timeout)<EOL>)<EOL>self._commands = []<EOL>logger.debug('<STR_LIT>' % r.status_code)<EOL>try:<EOL><INDENT>logger.debug('<STR_LIT>' % r.json())<EOL><DEDENT>except:<EOL><INDENT>logger.debug('<STR_LIT>' % r.content)<EOL><DEDENT>return r<EOL>
Execute all currently queued batch commands