def _execute_batch(self, actions):
wire_form = [a.wire_dict() for a in actions]<EOL>if self.test_mode:<EOL><INDENT>result = self.make_call("<STR_LIT>" % self.org_id, wire_form)<EOL><DEDENT>else:<EOL><INDENT>result = self.make_call("<STR_LIT>" % self.org_id, wire_form)<EOL><DEDENT>body = result.json()<EOL>if body.get("<STR_LIT>", None) is None:<EOL><INDENT>if body.get("<STR_LIT:result>") != "<STR_LIT:success>":<EOL><INDENT>if self.logger: self.logger.warning("<STR_LIT>", body)<EOL><DEDENT>return len(actions)<EOL><DEDENT>try:<EOL><INDENT>if body.get("<STR_LIT:result>") == "<STR_LIT:success>":<EOL><INDENT>if self.logger: self.logger.warning("<STR_LIT>", body)<EOL><DEDENT>for error in body["<STR_LIT>"]:<EOL><INDENT>actions[error["<STR_LIT:index>"]].report_command_error(error)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>raise ClientError(str(body), result)<EOL><DEDENT>return body.get("<STR_LIT>", <NUM_LIT:0>)<EOL>
Execute a single batch of Actions.
For each action that has a problem, we annotate the action with the
error information for that action, and we return the number of
successful actions in the batch.
:param actions: the list of Action objects to be executed
:return: count of successful actions