Helper function used by `run`.
480132
def get_server_setting(self, protocol, host='127.0.0.1', port=8000,
                           debug=False, ssl=None, sock=None, workers=1,
                           loop=None, backlog=100, has_log=True):
        ''''''

        if isinstance(ssl, dict):
            # try common aliaseses
            cert = ssl.get('cert') or ssl.get('certificate')
            key = ssl.get('key') or ssl.get('keyfile')
            if cert is None or key is None:
                raise ValueError('SSLContext or certificate and key required.')
            context = create_default_context(purpose=Purpose.CLIENT_AUTH)
            context.load_cert_chain(cert, keyfile=key)
            ssl = context

        server_settings = {
            'protocol': protocol,
            'request_handler': self.request_handler,
            'log': self.log,
            'netlog': self.netlog,
            'host': host,
            'port': port,
            'sock': sock,
            'ssl': ssl,
            'signal': self.signal,
            'debug': debug,
            'request_timeout': self.request_timeout,
            'request_max_size': self.request_max_size,
            'keep_alive': self.keep_alive,
            'loop': loop,
            'backlog': backlog,
            'has_log': has_log
        }
        for event_name, settings_name, reverse in (
                ('before_server_start', 'before_start', False),
                ('after_server_start', 'after_start', False),
                ('before_server_stop', 'before_stop', True),
                ('after_server_stop', 'after_stop', True),
        ):
            listeners = self.listeners[event_name].copy()
            if reverse:
                listeners.reverse()
            # Prepend mach9 to the arguments when listeners are triggered
            listeners = [partial(listener, self.app) for listener in listeners]
            server_settings[settings_name] = listeners

        if debug:
            self.log.setLevel(logging.DEBUG)

        # Serve
        if host and port:
            proto = 'http'
            if ssl is not None:
                proto = 'https'
            self.log.info('Goin\' Fast @ {}://{}:{}'.format(proto, host, port))
        return server_settings
937171
def run(state, command, args):
    """"""
    from ..core import do_run
    do_run(
        command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
    )
734497
def run(program, *args, **kwargs):
    """'"""
    args = flattened(args, split=SHELL)
    full_path = which(program)

    logger = kwargs.pop("logger", LOG.debug)
    fatal = kwargs.pop("fatal", True)
    dryrun = kwargs.pop("dryrun", is_dryrun())
    include_error = kwargs.pop("include_error", False)

    message = "Would run" if dryrun else "Running"
    message = "%s: %s %s" % (message, short(full_path or program), represented_args(args))
    if logger:
        logger(message)

    if dryrun:
        return message

    if not full_path:
        return abort("%s is not installed", short(program), fatal=fatal)

    stdout = kwargs.pop("stdout", subprocess.PIPE)
    stderr = kwargs.pop("stderr", subprocess.PIPE)
    args = [full_path] + args
    try:
        path_env = kwargs.pop("path_env", None)
        if path_env:
            kwargs["env"] = added_env_paths(path_env, env=kwargs.get("env"))
        p = subprocess.Popen(args, stdout=stdout, stderr=stderr, **kwargs)  # nosec
        output, err = p.communicate()
        output = decode(output, strip=True)
        err = decode(err, strip=True)

        if p.returncode and fatal is not None:
            note = ": %s\n%s" % (err, output) if output or err else ""
            message = "%s exited with code %s%s" % (short(program), p.returncode, note.strip())
            return abort(message, fatal=fatal)

        if include_error and err:
            output = "%s\n%s" % (output, err)
        return output and output.strip()

    except Exception as e:
        return abort("%s failed: %s", short(program), e, exc_info=e, fatal=fatal)
544829
def runUAT(self, args):
		
		Utility.run([self.getRunUATScript()] + args, cwd=self.getEngineRoot(), raiseOnError=True)
961780
def run(func):
    """"""

    @defaults.command(help='Run the service')
    @click.pass_context
    def runserver(ctx, *args, **kwargs):
        if (ctx.parent.invoked_subcommand and
                ctx.command.name != ctx.parent.invoked_subcommand):
            return

        # work around the fact that tornado's parse_command_line can't
        # cope with having subcommands / positional arguments.
        sys.argv = [sys.argv[0]] + [a for a in sys.argv if a[0] == '-']

        sys.exit(func())

    return runserver
770016
def run(self):
        """"""
        self.logger.debug(f'Running command: {self.cmd}')

        def execute(cmd):
            output = ""
            popen = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                                     universal_newlines=True, shell=True)
            for stdout_line in iter(popen.stdout.readline, ""):
                stdout_line = stdout_line.strip('\n')
                output += stdout_line
                yield stdout_line
            popen.stdout.close()
            return_code = popen.wait()
            if return_code:
                raise subprocess.CalledProcessError(return_code, cmd, output)

        try:
            for out in execute(self.cmd):
                self.logger.info(out)
            return "", 0
        except subprocess.CalledProcessError as e:
            return e.output, e.returncode
307679
def do_run(self,args):
        """"""
        parser = CommandArgumentParser("run")
        parser.add_argument('-R','--replace-key',dest='replaceKey',default=False,action='store_true',help="Replace the host's key. This is useful when AWS recycles an IP address you've seen before.")
        parser.add_argument('-Y','--keyscan',dest='keyscan',default=False,action='store_true',help="Perform a keyscan to avoid having to say 'yes' for a new host. Implies -R.")
        parser.add_argument('-ii','--ignore-host-key',dest='ignore-host-key',default=False,action='store_true',help='Ignore host key')
        parser.add_argument('-ne','--no-echo',dest='no-echo',default=False,action='store_true',help='Do not echo command')
        parser.add_argument(dest='command',nargs='+',help="Command to run on all hosts.") # consider adding a filter option later
        parser.add_argument('-v',dest='verbosity',default=0,action=VAction,nargs='?',help='Verbosity. The more instances, the more verbose');        
        parser.add_argument('-j',dest='jobs',type=int,default=1,help='Number of hosts to contact in parallel');
        parser.add_argument('-s',dest='skip',type=int,default=0,help='Skip this many hosts');
        parser.add_argument('-m',dest='macro',default=False,action='store_true',help='{command} is a series of macros to execute, not the actual command to run on the host');
        args = vars(parser.parse_args(args))

        replaceKey = args['replaceKey']
        keyscan = args['keyscan']
        verbosity = args['verbosity']
        jobs = args['jobs']
        skip = args['skip']
        ignoreHostKey = args['ignore-host-key']
        noEcho = args['no-echo']

        instances = self.scalingGroupDescription['AutoScalingGroups'][0]['Instances']
        instances = instances[skip:]
        # if replaceKey or keyscan:
        #     for instance in instances:
        #         stdplus.resetKnownHost(instance)

        if args['macro']:
            if len(args['command']) > 1:
                print("Only one macro may be specified with the -m switch.")
                return
            else:
                macro = args['command'][0]
                print("Macro:{}".format(macro))
                command = Config.config['ssh-macros'][macro]
        else:
            command = ' '.join(args['command'])
            
        Parallel(n_jobs=jobs)(
            delayed(ssh)(instance['InstanceId'],0,[],replaceKey,keyscan,False,verbosity,command,ignoreHostKey=ignoreHostKey,echoCommand=not noEcho,name="{}:{}: ".format(instance['index'],instance['InstanceId'])) for instance in instances
        )
1108822
def run(cmd, filename=None, threads=True, verbose=False):
    """"""
    _run(threads, verbose, 'run', filename, cmd)
1305862
def run_func(entry):
    """"""
    if entry.func:
        if entry.args and entry.krgs:
            return entry.func(*entry.args, **entry.krgs)
        if entry.args:
            return entry.func(*entry.args)
        if entry.krgs:
            return entry.func(**entry.krgs)
        return entry.func()
133289
def run(self, func, *func_args, **func__kwargs):
        
        self._func = func
        self._func_args = func_args
        self._func_kwargs = func__kwargs
        return self
1374322
def runner(self, classpath, main, jvm_options=None, args=None, cwd=None):
    """"""
    return self._runner(*self._scrub_args(classpath, main, jvm_options, args, cwd=cwd))
600307
def dry_run(func):
    """"""
    @wraps(func)
    def inner(dry_run, *args, **kwargs):
        ret = func(dry_run=dry_run, *args, **kwargs)
        if not dry_run:
            db.session.commit()
        else:
            db.session.rollback()
        return ret
    return inner
161651
def run_file(path):
    """"""
    if PY26:
        dirpath, name, _ = splitname(path)
        found = imp.find_module(name, [dirpath])
        module = imp.load_module("__main__", *found)
        return vars(module)
    else:
        return runpy.run_path(path, run_name="__main__")
97311
def run_job(self):
        """"""
        try:
            self.load_parsers()
            self.load_filters()
            self.load_outputs()
            self.config_args()
            if self.args.list_parsers:
                self.list_parsers()
            if self.args.verbosemode: print('Loading input files')
            self.load_inputs()
            if self.args.verbosemode: print('Running parsers')
            self.run_parse()
            if self.args.verbosemode: print('Merging data')
            self.data_set['finalized_data'] = \
                    logdissect.utils.merge_logs(
                            self.data_set['data_set'], sort=True)
            if self.args.verbosemode: print('Running filters')
            self.run_filters()
            if self.args.verbosemode: print('Running output')
            self.run_output()
        except KeyboardInterrupt:
            sys.exit(1)
1082362
def run_payload(self, payload, *, flavour: ModuleType):
        """"""
        return self.runners[flavour].run_payload(payload)
315839
def run(main=None, argv=None):
    """"""
    flags_obj = flags.FLAGS
    absl_flags_obj = absl_flags.FLAGS

    # Extract the args from the optional `argv` list.
    args = argv[1:] if argv else None

    # Parse the known flags from that list, or from the command
    # line otherwise.
    # pylint: disable=protected-access
    flags_passthrough = flags_obj._parse_flags(args=args)
    # pylint: enable=protected-access

    # Immediately after flags are parsed, bump verbosity to INFO if the flag has
    # not been set.
    if absl_flags_obj["verbosity"].using_default_value:
        absl_flags_obj.verbosity = 0

    main = main or sys.modules['__main__'].main

    # Call the main function, passing through any arguments
    # to the final program.
    sys.exit(main(sys.argv[:1] + flags_passthrough))
1173444
def run(self):
        """"""
        with utils.ChangeDir(self.dirname):
            sys.path.insert(0, self.dirname)
            sys.argv[1:] = self.args
            runpy.run_module(self.not_suffixed(self.filename),
                             run_name='__main__',
                             alter_sys=True)