def execute_batch_tasks(self, tasks_cls, big_delay=<NUM_LIT:0>, small_delay=<NUM_LIT:0>, wait_for_threads=True):
def _split_tasks(tasks_cls):<EOL><INDENT>"""<STR_LIT>"""<EOL>backend_t = []<EOL>global_t = []<EOL>for t in tasks_cls:<EOL><INDENT>if t.is_backend_task(t):<EOL><INDENT>backend_t.append(t)<EOL><DEDENT>else:<EOL><INDENT>global_t.append(t)<EOL><DEDENT><DEDENT>return backend_t, global_t<EOL><DEDENT>backend_tasks, global_tasks = _split_tasks(tasks_cls)<EOL>logger.debug('<STR_LIT>' % (backend_tasks))<EOL>logger.debug('<STR_LIT>' % (global_tasks))<EOL>threads = []<EOL>stopper = threading.Event()<EOL>if len(backend_tasks) > <NUM_LIT:0>:<EOL><INDENT>repos_backend = self._get_repos_by_backend()<EOL>for backend in repos_backend:<EOL><INDENT>t = TasksManager(backend_tasks, backend, stopper, self.config, small_delay)<EOL>threads.append(t)<EOL>t.start()<EOL><DEDENT><DEDENT>if len(global_tasks) > <NUM_LIT:0>:<EOL><INDENT>gt = TasksManager(global_tasks, "<STR_LIT>", stopper, self.config, big_delay)<EOL>threads.append(gt)<EOL>gt.start()<EOL>if big_delay > <NUM_LIT:0>:<EOL><INDENT>when = datetime.now() + timedelta(seconds=big_delay)<EOL>when_str = when.strftime('<STR_LIT>')<EOL>logger.info("<STR_LIT>" % (global_tasks, when_str))<EOL><DEDENT><DEDENT>if wait_for_threads:<EOL><INDENT>time.sleep(<NUM_LIT:1>)  <EOL>stopper.set()  <EOL><DEDENT>for t in threads:<EOL><INDENT>t.join()<EOL><DEDENT>self.__check_queue_for_errors()<EOL>logger.debug("<STR_LIT>")<EOL>
Start a task manager per backend to complete the tasks.

:param task_cls: list of tasks classes to be executed
:param big_delay: seconds before global tasks are executed, should be days usually
:param small_delay: seconds before backend tasks are executed, should be minutes
:param wait_for_threads: boolean to set when threads are infinite or
                        should be synchronized in a meeting point