def _create_executor(self, handler, args, cpus_per_worker=<NUM_LIT:1>):
if self._args.parallel > <NUM_LIT:0>:<EOL><INDENT>workers = self._args.parallel<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>workers = mp.cpu_count() // cpus_per_worker<EOL><DEDENT>except NotImplementedError:<EOL><INDENT>workers = <NUM_LIT:1><EOL><DEDENT><DEDENT>if workers != <NUM_LIT:1>:<EOL><INDENT>logger.info('<STR_LIT>'.format(<EOL>workers))<EOL>executor = ProcessPoolExecutor(<EOL>processes=workers, handler_init=handler, handler_args=args)<EOL><DEDENT>else:<EOL><INDENT>logger.info('<STR_LIT>')<EOL>executor = SequentialExecutor(<EOL>handler_init=handler, handler_args=args)<EOL><DEDENT>return executor<EOL>
Return a new :class:`.Executor` instance.