Start process worker for given method args and kwargs.
483625
def _start(self):
        """"""
        error = None
        output = None

        try:
            output = self.func(*self.args, **self.kwargs)
        except Exception as err:
            error = err

        if not self._is_finished:
            self.sig_finished.emit(self, output, error)
        self._is_finished = True
696384
def execute(*args, **kwargs):
    """"""
    if kwargs:
        # TODO: Remove this when pyntcontrib's execute does this
        args = list(args)
        args.extend(_kwargs_to_execute_args(kwargs))
    _execute(*args)
1274077
def run_multiple_processes(args_list: List[List[str]],
                           die_on_failure: bool = True) -> None:
    
    for procargs in args_list:
        start_process(procargs)
    # Wait for them all to finish
    wait_for_processes(die_on_failure=die_on_failure)
24273
def run_process(path: Union[Path, str], target: Callable, *,
                args: Tuple=(),
                kwargs: Dict[str, Any]=None,
                callback: Callable[[Set[Tuple[Change, str]]], None]=None,
                watcher_cls: Type[AllWatcher]=PythonWatcher,
                debounce=400,
                min_sleep=100):
    

    process = _start_process(target=target, args=args, kwargs=kwargs)
    reloads = 0

    for changes in watch(path, watcher_cls=watcher_cls, debounce=debounce, min_sleep=min_sleep):
        callback and callback(changes)
        _stop_process(process)
        process = _start_process(target=target, args=args, kwargs=kwargs)
        reloads += 1
    return reloads
813471
def main():
    """"""
    # Generate a argparse parser and parse the command-line arguments
    parser = makeParser()
    args = parser.parse_args()

    # Get a list of resources to launch worker(s) on
    hosts = utils.getHosts(args.hostfile, args.hosts)

    if args.n:
        n = args.n
    else:
        n = utils.getWorkerQte(hosts)
    assert n >= 0, (
            "Scoop couldn't determine the number of worker to start.\n"
            "Use the '-n' flag to set it manually."
    )

    if not args.external_hostname:
        args.external_hostname = [utils.externalHostname(hosts)]

    # Launch SCOOP
    thisScoopApp = ScoopApp(hosts, n, args.b,
                            args.verbose if not args.quiet else 0,
                            args.python_interpreter,
                            args.external_hostname[0],
                            args.executable, args.args, args.tunnel,
                            args.path, args.debug, args.nice,
                            utils.getEnv(), args.profile, args.pythonpath[0],
                            args.prolog[0], args.backend, args.rsh,
                            args.ssh_executable)

    rootTaskExitCode = False
    interruptPreventer = Thread(target=thisScoopApp.close)
    try:
        rootTaskExitCode = thisScoopApp.run()
    except Exception as e:
        logging.error('Error while launching SCOOP subprocesses:')
        logging.error(traceback.format_exc())
        rootTaskExitCode = -1
    finally:
        # This should not be interrupted (ie. by a KeyboadInterrupt)
        # The only cross-platform way to do it I found was by using a thread.
        interruptPreventer.start()
        interruptPreventer.join()

    # Exit with the proper exit code
    if rootTaskExitCode:
        sys.exit(rootTaskExitCode)
753041
def initialize_worker(self):
        """"""
        worker_thread = threading.Thread(
            name="WorkerThread", target=message_worker, args=(self,))
        worker_thread.setDaemon(True)
        worker_thread.start()
118992
def run(task_creators, args, task_selectors=[]):
    
    if args.reset_dep:
        sys.exit(DoitMain(WrapitLoader(args, task_creators)).run(['reset-dep']))
    else:
        sys.exit(DoitMain(WrapitLoader(args, task_creators)).run(task_selectors))
85772
def start(self, sockets=None, **kwargs):
        

        pty_stdin, pty_stdout, pty_stderr = sockets or self.sockets()
        pumps = []

        if pty_stdin and self.interactive:
            pumps.append(io.Pump(io.Stream(self.stdin), pty_stdin, wait_for_output=False))

        if pty_stdout:
            pumps.append(io.Pump(pty_stdout, io.Stream(self.stdout), propagate_close=False))

        if pty_stderr:
            pumps.append(io.Pump(pty_stderr, io.Stream(self.stderr), propagate_close=False))

        if not self._container_info()['State']['Running']:
            self.client.start(self.container, **kwargs)

        return pumps
197008
def main(**kwargs):
    """"""
    options = ApplicationOptions(**kwargs)
    Event.configure(is_logging_enabled=options.event_logging)
    application = Application(options)
    application.run(options.definition)
969591
def run(self, **kwargs):
        
        super().run(**kwargs)
        scheduler = self.scheduler_plugins[self.active_scheduler]()

        if not kwargs['no_daemon']:
            self.log.info('Starting {} worker with {} threads checking for new messages every {} seconds'.format(
                scheduler.name,
                kwargs['threads'],
                kwargs['delay']
            ))

            for i in range(kwargs['threads']):
                thd = threading.Thread(
                    target=self.execute_worker_thread,
                    args=(scheduler.execute_worker, kwargs['delay'])
                )
                thd.start()
        else:
            self.log.info('Starting {} worker for a single non-daemon execution'.format(
                scheduler.name
            ))
            scheduler.execute_worker()
86511
def start(self, **kwargs):
        
        return self.client.api.start(self.id, **kwargs)
833309
def spawn_thread(func, *args, **kwargs):
    """"""
    thread = threading.Thread(target=func, args=args, kwargs=kwargs)
    thread.daemon = True
    thread.start()
    return thread
960110
def start(self, use_atexit=True):
        '''
        '''
        assert not self._process

        _logger.debug('Starting process %s', self._proc_args)

        process_future = asyncio.create_subprocess_exec(
            stdin=subprocess.PIPE,
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            *self._proc_args
        )
        self._process = yield from process_future

        self._stderr_reader = asyncio.async(self._read_stderr())
        self._stdout_reader = asyncio.async(self._read_stdout())

        if use_atexit:
            atexit.register(self.close)
752604
def start(client, container, interactive=True, stdout=None, stderr=None, stdin=None, **kwargs):
    

    PseudoTerminal(client, container, interactive=interactive, stdout=stdout, stderr=stderr, stdin=stdin).start(**kwargs)
466945
def open(self, *args, **kwargs):
        
        args, kwargs = self.__process__(*args, **kwargs)
        return Popen(args, **kwargs)
39818
@Override
    public void start(String[] arguments) {
        boolean notStarted = !started.getAndSet(true);
        if (notStarted) {
            start(new SingleInstanceWorkloadStrategy(job, name, arguments, endpointRegistry, execService));
        }
    }
1115660
async def run(self, kwargs=None):
        
        task = self._prepare(kwargs)

        try:
            await task
        except Exception as e:
            # FIXME: write a better Exception handler.
            raise e