Executes Phing and runs a specified targets
163990
public function execute()
    {
        $phingExecutable = $this->phpci->findBinary('phing');

        $cmd[] = $phingExecutable . ' -f ' . $this->getBuildFilePath();

        if ($this->getPropertyFile()) {
            $cmd[] = '-propertyfile ' . $this->getPropertyFile();
        }

        $cmd[] = $this->propertiesToString();

        $cmd[] = '-logger phing.listener.DefaultLogger';
        $cmd[] = $this->targetsToString();
        $cmd[] = '2>&1';

        return $this->phpci->executeCommand(implode(' ', $cmd), $this->directory, $this->targets);
    }
810377
public function main()
    {
        if ($this->prefix != null && $this->regex != null) {
            throw new BuildException("Please specify either prefix or regex, but not both", $this->getLocation());
        }

        //copy the properties file
        $allProps = [];

        /* load properties from file if specified, otherwise use Phing's properties */
        if ($this->inFile == null) {
            // add phing properties
            $allProps = $this->getProject()->getProperties();
        } elseif ($this->inFile != null) {
            if ($this->inFile->exists() && $this->inFile->isDirectory()) {
                $message = "srcfile is a directory!";
                $this->failOnErrorAction(null, $message, Project::MSG_ERR);
                return;
            }

            if ($this->inFile->exists() && !$this->inFile->canRead()) {
                $message = "Can not read from the specified srcfile!";
                $this->failOnErrorAction(null, $message, Project::MSG_ERR);
                return;
            }

            try {
                $props = new Properties();
                $props->load(new PhingFile($this->inFile));
                $allProps = $props->getProperties();
            } catch (IOException $ioe) {
                $message = "Could not read file " . $this->inFile->getAbsolutePath();
                $this->failOnErrorAction($ioe, $message, Project::MSG_WARN);
                return;
            }
        }

        $os = null;
        try {
            if ($this->destfile == null) {
                $os = Phing::getOutputStream();
                $this->saveProperties($allProps, $os);
                $this->log($os, Project::MSG_INFO);
            } else {
                if ($this->destfile->exists() && $this->destfile->isDirectory()) {
                    $message = "destfile is a directory!";
                    $this->failOnErrorAction(null, $message, Project::MSG_ERR);
                    return;
                }

                if ($this->destfile->exists() && !$this->destfile->canWrite()) {
                    $message = "Can not write to the specified destfile!";
                    $this->failOnErrorAction(null, $message, Project::MSG_ERR);
                    return;
                }
                $os = new FileOutputStream($this->destfile);
                $this->saveProperties($allProps, $os);
            }
        } catch (IOException $ioe) {
            $this->failOnErrorAction($ioe);
        }
    }
1281220
def run():
    """"""
    
    # Grab server args
    args = client_helper.grab_server_args()

    # Start up workbench connection
    workbench = zerorpc.Client(timeout=300, heartbeat=60)
    workbench.connect('tcp://'+args['server']+':'+args['port'])

    # Upload the files into workbench
    my_file = os.path.join(os.path.dirname(os.path.realpath(__file__)),
                           '../data/pcap/gold_xxx.pcap')
    with open(my_file,'rb') as f:

        # We're going to upload the file in chunks to workbench 
        filename = os.path.basename(my_file)
        raw_bytes = f.read()
        md5_list = []
        for chunk in chunks(raw_bytes, 1024*1024):
            md5_list.append(workbench.store_sample(chunk, filename, 'exe'))

        # Now we just ask Workbench to combine these
        combined_md5 = workbench.combine_samples(md5_list, filename, 'exe')
        real_md5 = workbench.store_sample(raw_bytes, filename, 'exe')
        assert(combined_md5 == real_md5)
338631
def run(self, *args, **kwargs):
        
        b_status            = True
        d_pftreeRun         = {}
        d_inputAnalysis     = {}
        d_env               = self.env_check()
        b_timerStart        = False

        self.dp.qprint(
                "\tStarting pfdicom run... (please be patient while running)", 
                level = 1
                )

        for k, v in kwargs.items():
            if k == 'timerStart':   b_timerStart    = bool(v)

        if b_timerStart:
            other.tic()

        if d_env['status']:
            d_pftreeRun = self.pf_tree.run(timerStart = False)
        else:
            b_status    = False 

        str_startDir    = os.getcwd()
        os.chdir(self.str_inputDir)
        if b_status:
            if len(self.str_extension):
                d_inputAnalysis = self.pf_tree.tree_process(
                                inputReadCallback       = None,
                                analysisCallback        = self.filelist_prune,
                                outputWriteCallback     = None,
                                applyResultsTo          = 'inputTree',
                                applyKey                = 'l_file',
                                persistAnalysisResults  = True
                )
        os.chdir(str_startDir)

        d_ret = {
            'status':           b_status and d_pftreeRun['status'],
            'd_env':            d_env,
            'd_pftreeRun':      d_pftreeRun,
            'd_inputAnalysis':  d_inputAnalysis,
            'runTime':          other.toc()
        }

        if self.b_json:
            self.ret_dump(d_ret, **kwargs)

        self.dp.qprint('\tReturning from pfdicom run...', level = 1)

        return d_ret
712329
def run(self, cmd, fn=None, globals=None, locals=None):
        """"""
        if globals is None:
            import __main__
            globals = __main__.__dict__
        if locals is None:
            locals = globals
        self.reset()
        if isinstance(cmd, str):
            str_cmd = cmd
            cmd = compile(str_cmd, fn or "<wdb>", "exec")
            self.compile_cache[id(cmd)] = str_cmd
        if fn:
            from linecache import getline
            lno = 1
            while True:
                line = getline(fn, lno, globals)
                if line is None:
                    lno = None
                    break
                if executable_line(line):
                    break
                lno += 1

        self.start_trace()
        if lno is not None:
            self.breakpoints.add(LineBreakpoint(fn, lno, temporary=True))
        try:
            execute(cmd, globals, locals)
        finally:
            self.stop_trace()
720431
def launch(run=True, **args):
    """"""

    verbosity['console'] = args['log'] if not args['quiet'] else 100
    verbosity['global'] = min(args['log'], args['logfileverbosity'])
    verbosity['file'] = args['logfileverbosity'] if args['dolog'] else 100
    set_logfile(args['logfilepath'], args['instance'])

    if args['livelog'] is True:
        from hfos import logger
        logger.live = True

    hfoslog("Running with Python", sys.version.replace("\n", ""),
            sys.platform, lvl=debug, emitter='CORE')
    hfoslog("Interpreter executable:", sys.executable, emitter='CORE')
    if args['cert'] is not None:
        hfoslog("Warning! Using SSL without nginx is currently not broken!",
                lvl=critical, emitter='CORE')

    hfoslog("Initializing database access", emitter='CORE', lvl=debug)
    initialize(args['dbhost'], args['dbname'], args['instance'])

    server = construct_graph(args)
    if run and not args['norun']:
        server.run()

    return server
782824
def run(self, conn, tmp, module_name, module_args, inject):
        '''  '''

        # shell and command module are the same
        if module_name == 'shell':
            module_name = 'command'
            module_args += " #USE_SHELL"

        (module_path, is_new_style, shebang) = self.runner._copy_module(conn, tmp, module_name, module_args, inject)
        self.runner._low_level_exec_command(conn, "chmod a+rx %s" % module_path, tmp)

        return self.runner._execute_module(conn, tmp, 'async_wrapper', module_args,
           async_module=module_path,
           async_jid=self.runner.generated_jid,
           async_limit=self.runner.background,
           inject=inject
        )
151621
def _execute_sbatch(self):
        
        commands = self.campaign.process.get('commands', {})
        sbatch = find_executable(commands.get('sbatch', 'sbatch'))
        sbatch_command = [sbatch, '--parsable', self.sbatch_filename]
        try:
            self.logger.debug(
                'Executing command: %s',
                ' '.join(map(six.moves.shlex_quote, sbatch_command)),
            )
            sbatch_out = subprocess.check_output(
                sbatch_command, universal_newlines=True
            )
        except subprocess.CalledProcessError as cpe:
            self.logger.error(
                "SBATCH return non-zero exit" "status %d for tag %s",
                cpe.returncode,
                self.tag,
            )
            sbatch_out = cpe.output
        jobidre = re.compile(r'^([\d]+)(?:;\S*)?$')
        jobid = None
        for line in sbatch_out.splitlines():
            res = jobidre.match(line)
            if res is not None:
                jobid = res.group(1)
                self.logger.info("Submitted SBATCH job %s for tag %s", jobid, self.tag)
            elif line:
                self.logger.warning("SBATCH: %s", line)
        if jobid is None:
            self.logger.error("SBATCH submission failed for tag %s", self.tag)
            return -1
        else:
            return int(jobid)
570315
def RunSphinxAPIDoc(_):
  """"""
  current_directory = os.path.abspath(os.path.dirname(__file__))
  module = os.path.join(current_directory, '..', 'plaso')
  api_directory = os.path.join(current_directory, 'sources', 'api')
  apidoc.main(['-o', api_directory, module, '--force'])
921289
def execute():
    """"""

    if len(sys.argv) <= 1:
        raise SystemExit(
            'No Arguments provided. use [--help] for more information.'
        )

    # Capture user arguments
    _args = arguments.ArgumentParserator(
        arguments_dict=turbolift.ARGUMENTS,
        env_name='TURBO',
        epilog=turbolift.VINFO,
        title='Turbolift',
        detail='Multiprocessing Swift CLI tool.',
        description='Manage Swift easily and fast.'
    )
    user_args = _args.arg_parser()
    user_args['run_indicator'] = True
    debug_log = False
    stream_logs = True

    # Load system logging
    if user_args.get('debug'):
        debug_log = True
        user_args['run_indicator'] = False

    # Load system logging
    if user_args.get('quiet'):
        stream_logs = False
        user_args['run_indicator'] = False

    _logging = logger.LogSetup(
        debug_logging=debug_log,
        colorized_messages=user_args.get('colorized', False)
    )
    _logging.default_logger(name='turbolift', enable_stream=stream_logs)
    job = worker.Worker(job_args=user_args)
    job.run_manager()
592111
def execute_java_for_coverage(self, targets, *args, **kwargs):
    

    distribution = self.preferred_jvm_distribution_for_targets(targets)
    actual_executor = SubprocessExecutor(distribution)
    return distribution.execute_java(*args, executor=actual_executor, **kwargs)
796898
def run():
    """"""
    import optparse

    parser = optparse.OptionParser(usage=r"%prog [<options>] [file ...]")
    parser.add_option(
        "-p", "--spread", type="float", default=3.0, help="Rainbow spread"
    )
    parser.add_option(
        "-F", "--freq", type="float", default=0.1, help="Rainbow frequency"
    )
    parser.add_option("-S", "--seed", type="int", default=0, help="Rainbow seed")
    parser.add_option(
        "-a",
        "--animate",
        action="store_true",
        default=False,
        help="Enable psychedelics",
    )
    parser.add_option(
        "-d", "--duration", type="int", default=12, help="Animation duration"
    )
    parser.add_option(
        "-s", "--speed", type="float", default=20.0, help="Animation speed"
    )
    parser.add_option(
        "-f",
        "--force",
        action="store_true",
        default=False,
        help="Force colour even when stdout is not a tty",
    )

    parser.add_option(
        "-3", action="store_const", dest="mode", const=8, help="Force 3 bit colour mode"
    )
    parser.add_option(
        "-4",
        action="store_const",
        dest="mode",
        const=16,
        help="Force 4 bit colour mode",
    )
    parser.add_option(
        "-8",
        action="store_const",
        dest="mode",
        const=256,
        help="Force 8 bit colour mode",
    )

    parser.add_option(
        "-c",
        "--charset-py2",
        default="utf-8",
        help="Manually set a charset to convert from, for python 2.7",
    )

    options, args = parser.parse_args()
    options.os = random.randint(0, 256) if options.seed == 0 else options.seed
    options.mode = options.mode or detect_mode()

    lolcat = LolCat(mode=options.mode)

    if not args:
        args = ["-"]

    for filename in args:
        if filename == "-":
            lolcat.cat(sys.stdin, options)
        else:
            try:
                with open(filename, "r") as handle:
                    lolcat.cat(handle, options)
            except IOError as error:
                sys.stderr.write(str(error) + "\n")
207721
def run(self):
        '''
        
        '''
        self._update_opts()
        cmd = self.opts['fun']

        veri = None
        ret = None
        try:
            if cmd in ('accept', 'reject', 'delete'):
                ret = self._run_cmd('name_match')
                if not isinstance(ret, dict):
                    salt.output.display_output(ret, 'key', opts=self.opts)
                    return ret
                ret = self._filter_ret(cmd, ret)
                if not ret:
                    self._print_no_match(cmd, self.opts['match'])
                    return
                print('The following keys are going to be {0}ed:'.format(cmd.rstrip('e')))
                salt.output.display_output(ret, 'key', opts=self.opts)

                if not self.opts.get('yes', False):
                    try:
                        if cmd.startswith('delete'):
                            veri = input('Proceed? [N/y] ')
                            if not veri:
                                veri = 'n'
                        else:
                            veri = input('Proceed? [n/Y] ')
                            if not veri:
                                veri = 'y'
                    except KeyboardInterrupt:
                        raise SystemExit("\nExiting on CTRL-c")
                # accept/reject/delete the same keys we're printed to the user
                self.opts['match_dict'] = ret
                self.opts.pop('match', None)
                list_ret = ret

            if veri is None or veri.lower().startswith('y'):
                ret = self._run_cmd(cmd)
                if cmd in ('accept', 'reject', 'delete'):
                    if cmd == 'delete':
                        ret = list_ret
                    for minions in ret.values():
                        for minion in minions:
                            print('Key for minion {0} {1}ed.'.format(minion,
                                                                     cmd.rstrip('e')))
                elif isinstance(ret, dict):
                    salt.output.display_output(ret, 'key', opts=self.opts)
                else:
                    salt.output.display_output({'return': ret}, 'key', opts=self.opts)
        except salt.exceptions.SaltException as exc:
            ret = '{0}'.format(exc)
            if not self.opts.get('quiet', False):
                salt.output.display_output(ret, 'nested', self.opts)
        return ret
806622
def run(
    categories, param_file, project_dir, plugin, target,
    status_update_interval
):
    
    return _run(
        categories, param_file, project_dir, plugin, target,
        status_update_interval
    )
1058829
def execute(self):
        
        if not self.config.pr:
            raise NotPullRequestException

        logger.debug('Using the following configuration:')
        for name, value in self.config.as_dict().items():
            logger.debug('  - {}={}'.format(name, repr(value)))

        logger.info('Running Lintly against PR #{} for repo {}'.format(self.config.pr, self.project))

        parser = PARSERS.get(self.config.format)
        self._all_violations = parser.parse_violations(self.linter_output)
        logger.info('Lintly found violations in {} files'.format(len(self._all_violations)))

        diff = self.get_pr_diff()
        patch = self.get_pr_patch(diff)
        self._diff_violations = self.find_diff_violations(patch)
        logger.info('Lintly found diff violations in {} files'.format(len(self._diff_violations)))

        self.post_pr_comment(patch)
        self.post_commit_status()
369508
def run(self):
        
        run_command = (
            settings.project_customization.runfile.read_text().split()
        )
        chmod_string = (
            "chmod +x "
            + settings.project_customization.runfile.absolute().as_posix()
        )
        subprocess.run(chmod_string.split())
        subprocess.run(
            run_command, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr
        )
1235381
public function main()
    {
        $buildFileRoot = $this->getProject()->getProperty('phing.file');
        $buildFile     = isset($this->_buildFile) ? $this->_buildFile : $buildFileRoot;
        $buildList     = $this->getBuildList($buildFileRoot);
        $parents       = array();
        $targets       = array();

        if (isset($this->_buildFile) && is_file($this->_buildFile)
            && !empty($this->getOwningTarget()->getName())
        ) {
            foreach ($buildList as $buildFile => $buildInfo) {
                if ($this->_buildFile === $buildFile
                    || in_array($buildInfo['parent'], $parents)
                ) {
                    $parents[] = $buildFile;
                    $targets   = array_merge(
                        $targets,
                        $this->getBuildTargets($buildFile)
                    );
                }
            }

            $targets = array_merge($targets, $this->project->helpTargets);
            $this->printBuildTargets($targets, $buildFile, $buildList);
        }

    }