Basic information about this run.
767082
def run_information(self):
    """"""
    run_information = self.run_info.get_as_dict()
    target_data = run_information.get('target_data', None)
    if target_data:
      run_information['target_data'] = ast.literal_eval(target_data)
    return run_information
96363
def run_all
      results = runner.run([options[:spec_dir]])

      self.last_failed_paths = results.keys
      self.last_run_failed   = !results.empty?

      throw :task_has_failed if last_run_failed
    end
1045281
def run(self):
        '''
        
        '''
        if self.opts['chunked']:
            ret = self.run_chunked()
        else:
            ret = self.run_oldstyle()

        salt.output.display_output(
                ret,
                self.opts.get('output', 'nested'),
                self.opts)
297975
def run(self):
        """"""
        titles = ['date', 'host', 'state/message']
        table_rows = []

        for host, state, logevent in self.mloginfo.logfile.rs_state:
            stats = OrderedDict()
            stats['date'] = logevent.datetime.strftime("%b %d %H:%M:%S")
            stats['host'] = host
            stats['state/message'] = state
            table_rows.append(stats)

        print_table(table_rows, titles, uppercase_headers=False)

        if len(self.mloginfo.logfile.rs_state) == 0:
            print("  no rs state changes found")
1078808
def main(argv=None):
  """"""
  args = parse_arguments(sys.argv if argv is None else argv)

  tf.logging.set_verbosity(tf.logging.INFO)
  learn_runner.run(
      experiment_fn=get_experiment_fn(args),
      output_dir=args.job_dir)
1352826
def start_running(self):
        """"""
        self.comp.warm_up()
        self.check_runner()
        self.running = True
974159
def run(args):
    """"""
    # Create an OSLOM runner with a temporary working directory
    oslom_runner = OslomRunner(tempfile.mkdtemp())

    # (Re-)create OSLOM output directory
    shutil.rmtree(args.oslom_output, ignore_errors=True)
    os.makedirs(args.oslom_output)

    # Read edges file
    logging.info("reading edges file: %s", args.edges)
    edges = []
    with open(args.edges, "r") as reader:
        for line in reader:
            source, target, weight = line.strip().split("\t", 2)
            edges.append((source, target, weight))
    logging.info("%d edge(s) found", len(edges))

    # Write temporary edges file with re-mapped Ids
    logging.info("writing temporary edges file with re-mapped Ids ...")
    oslom_runner.store_edges(edges)

    # Run OSLOM
    logging.info("running OSLOM ...")
    result = oslom_runner.run(
        args.oslom_exec, args.oslom_args,
        os.path.join(args.oslom_output, OSLOM_LOG_FILE))
    if result["retval"] != 0:
        logging.error("error running OSLOM, check the log file")
        return False
    logging.info("OSLOM executed in %.3f secs", result["time"])

    # Read back clusters found by OSLOM
    logging.info("reading OSLOM clusters output file ...")
    clusters = oslom_runner.read_clusters(args.min_cluster_size)
    logging.info(
        "found %d cluster(s) and %d with size >= %d",
        clusters["num_found"], len(clusters["clusters"]), args.min_cluster_size)

    # Write clusters file
    logging.info("writing output clusters file: %s", args.output_clusters)
    with open(args.output_clusters, "w") as writer:
        json.dump(clusters["clusters"], writer, separators=(",", ":"))

    # Store OSLOM output files
    logging.info("writing OSLOM output files ...")
    oslom_runner.store_output_files(args.oslom_output)

    # Clean-up temporary working directory
    oslom_runner.cleanup()

    # Finished
    logging.info("finished")
    return True
242815
def run(self): # No "_" in the name, but nevertheless, running in the backed
        
        self.preRun_()
        self.running=True
        
        while(self.running):
            self.cycle_()
            self.handleSignal_()
        
        self.postRun_()
865819
def running(name, restart=False, force=True):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}
    if not __salt__['marathon.has_app'](name):
        ret['result'] = False
        ret['comment'] = 'App {0} cannot be restarted because it is absent'.format(name)
        return ret
    if __opts__['test']:
        ret['result'] = None
        qualifier = 'is' if restart else 'is not'
        ret['comment'] = 'App {0} {1} set to be restarted'.format(name, qualifier)
        return ret
    restart_result = __salt__['marathon.restart_app'](name, restart, force)
    if 'exception' in restart_result:
        ret['result'] = False
        ret['comment'] = 'Failed to restart app {0}: {1}'.format(
            name,
            restart_result['exception']
        )
        return ret
    else:
        ret['changes'] = restart_result
        ret['result'] = True
        qualifier = 'Restarted' if restart else 'Did not restart'
        ret['comment'] = '{0} app {1}'.format(qualifier, name)
        return ret
355962
function List(runner) {
  Base.call(this, runner);

  var self = this;
  var stats = this.stats;
  var total = runner.total;

  runner.on('start', function(){
    // console.log(JSON.stringify( ['start', { total: total }] ));
  });

  runner.on('suite', function(suite){
    if (suite.id != undefined) {
      // console.log(JSON.stringify( ['suite', suite_info(suite)] ));
      console.log(suite.title + ':')
    }
  });

  runner.on('test', function(test){
    // console.log(JSON.stringify( ['test', info(test)] ));
  });

  runner.on('pass', function(test){
    //console.log(JSON.stringify( ['pass', pass(test)] ));
    console.log(':-) ' + test.title)
    //process.stdout.write('.')
  });

  runner.on('fail', function(test, err){
    
    //test = fail(test, err);
    //console.log(JSON.stringify( ['fail', test] ));
    console.log(':-( ' + test.title)
    console.log('\nvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv FAIL vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv\n');
    console.log('Title: ' + test.title + '\n');
    console.log(err.stack);
    console.log('^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FAIL ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n');  
    
  });

  runner.on('test end', function(test){
    //console.log(JSON.stringify( ['test end', {id: test.id}] ));
  });

  runner.on('suite end', function(suite){
    if (suite.id != undefined) {
      //console.log(JSON.stringify( ['suite end', {id: suite.id}] ));
    }
  });

  runner.on('end', function(){
    //console.log(JSON.stringify( ['end', self.stats] ));
    console.log('\nSummary:')
    pluralized = '';
    if (self.stats.passes != 1) {
      pluralized = 'es';
    }  
    console.log(self.stats.passes + ' pass' + pluralized)
    
    pluralized = '';
    if (self.stats.failures != 1) {
      pluralized = 's';
    }      
    console.log(self.stats.failures + ' failure' + pluralized) 
    console.log('--------------------------')    

    pluralized = '';
    if (self.stats.tests != 1) {
      pluralized = 's';
    }
    console.log(self.stats.tests + ' test' + pluralized + ' (' + self.stats.duration + 'ms)\n')
    
  });
}
281023
function Base(runner) {
  var self = this
    , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 }
    , failures = this.failures = [];

  if (!runner) return;
  this.runner = runner;

  runner.stats = stats;

  runner.on('start', function(){
    stats.start = new Date;
  });

  runner.on('suite', function(suite){
    stats.suites = stats.suites || 0;
    suite.root || stats.suites++;
  });

  runner.on('test end', function(test){
    stats.tests = stats.tests || 0;
    stats.tests++;
  });

  runner.on('pass', function(test){
    stats.passes = stats.passes || 0;

    var medium = test.slow() / 2;
    test.speed = test.duration > test.slow()
      ? 'slow'
      : test.duration > medium
        ? 'medium'
        : 'fast';

    stats.passes++;
  });

  runner.on('fail', function(test, err){
    stats.failures = stats.failures || 0;
    stats.failures++;
    test.err = err;
    failures.push(test);
  });

  runner.on('end', function(){
    stats.end = new Date;
    stats.duration = new Date - stats.start;
  });

  runner.on('pending', function(){
    stats.pending++;
  });
}
450035
function List(runner) {
  Base.call(this, runner);

  var self = this
    , stats = this.stats
    , total = runner.total;

  runner.on('start', function(){
    console.log(JSON.stringify(['start', { total: total }]));
  });

  runner.on('pass', function(test){
    console.log(JSON.stringify(['pass', clean(test)]));
  });

  runner.on('fail', function(test, err){
    console.log(JSON.stringify(['fail', clean(test)]));
  });

  runner.on('end', function(){
    process.stdout.write(JSON.stringify(['end', self.stats]));
  });
}
739658
def runner(self):
        
        sero_report = os.path.join(self.reportpath, 'serosippr.csv')
        if os.path.isfile(sero_report):
            self.report_parse(sero_report)
        else:
            logging.info('Starting {} analysis pipeline'.format(self.analysistype))
            # Run the analyses
            ShortKSippingMethods(self, self.cutoff)
            self.serotype_escherichia()
            self.serotype_salmonella()
            # Create the reports
            self.reporter()
            # Print the metadata
            MetadataPrinter(self)
530460
public function run()
    {
        // Setting up the styles
        echo '<style type="text/css">';
        echo '#bodydiv { font: 10px sans-serif;}';
        foreach ($this->styles as $class => $style) {
            echo '.', $class, ' { ';
            if ($style['font'] === 'dejavusans') {
                $style['font'] = $this->default_font;
            }
            echo 'font-family: ', $style['font'], '; ';
            echo 'font-size: ', $style['size'], 'pt; ';
            // Case-insensitive
            if (stripos($style['style'], 'B') !== false) {
                echo 'font-weight: bold; ';
            }
            if (stripos($style['style'], 'I') !== false) {
                echo 'font-style: italic; ';
            }
            if (stripos($style['style'], 'U') !== false) {
                echo 'text-decoration: underline; ';
            }
            if (stripos($style['style'], 'D') !== false) {
                echo 'text-decoration: line-through; ';
            }
            echo '}', PHP_EOL;
        }
        unset($class, $style);
        //-- header divider
        echo '</style>', PHP_EOL;
        echo '<div id="headermargin" style="position: relative; top: auto; height: ', $this->header_margin, 'pt; width: ', $this->noMarginWidth, 'pt;"></div>';
        echo '<div id="headerdiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt;">';
        foreach ($this->headerElements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($this);
            } elseif ($element === 'footnotetexts') {
                $this->footnotes();
            } elseif ($element === 'addpage') {
                $this->addPage();
            }
        }
        //-- body
        echo '</div>';
        echo '<script>document.getElementById("headerdiv").style.height="', $this->top_margin - $this->header_margin - 6, 'pt";</script>';
        echo '<div id="bodydiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt; height: 100%;">';
        $this->Y    = 0;
        $this->maxY = 0;
        $this->runPageHeader();
        foreach ($this->bodyElements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($this);
            } elseif ($element === 'footnotetexts') {
                $this->footnotes();
            } elseif ($element === 'addpage') {
                $this->addPage();
            }
        }
        //-- footer
        echo '</div>';
        echo '<script>document.getElementById("bodydiv").style.height="', $this->maxY, 'pt";</script>';
        echo '<div id="bottommargin" style="position: relative; top: auto; height: ', $this->bottom_margin - $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>';
        echo '<div id="footerdiv" style="position: relative; top: auto; width: ', $this->noMarginWidth, 'pt;height:auto;">';
        $this->Y    = 0;
        $this->X    = 0;
        $this->maxY = 0;
        foreach ($this->footerElements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($this);
            } elseif ($element === 'footnotetexts') {
                $this->footnotes();
            } elseif ($element === 'addpage') {
                $this->addPage();
            }
        }
        echo '</div>';
        echo '<script>document.getElementById("footerdiv").style.height="', $this->maxY, 'pt";</script>';
        echo '<div id="footermargin" style="position: relative; top: auto; height: ', $this->footer_margin, 'pt;width:', $this->noMarginWidth, 'pt;"></div>';
    }
855705
def _postrun(self, result):
        
        logger.debug(
            "{}.PostRun: {}[{}]".format(
                self.__class__.__name__, self.__class__.path, self.uuid
            ),
            extra=dict(
                kmsg=Message(
                    self.uuid, entrypoint=self.__class__.path,
                    params=self.params, metadata=self.metadata
                ).dump()
            )
        )
        return self.postrun(result)
1260689
def run(self):
        '''
        
        '''
        import salt.runner
        self.parse_args()

        # Setup file logging!
        self.setup_logfile_logger()
        verify_log(self.config)
        profiling_enabled = self.options.profiling_enabled

        runner = salt.runner.Runner(self.config)
        if self.options.doc:
            runner.print_docs()
            self.exit(salt.defaults.exitcodes.EX_OK)

        # Run this here so SystemExit isn't raised anywhere else when
        # someone tries to use the runners via the python API
        try:
            if check_user(self.config['user']):
                pr = salt.utils.profile.activate_profile(profiling_enabled)
                try:
                    ret = runner.run()
                    # In older versions ret['data']['retcode'] was used
                    # for signaling the return code. This has been
                    # changed for the orchestrate runner, but external
                    # runners might still use it. For this reason, we
                    # also check ret['data']['retcode'] if
                    # ret['retcode'] is not available.
                    if isinstance(ret, dict) and 'retcode' in ret:
                        self.exit(ret['retcode'])
                    elif isinstance(ret, dict) and 'retcode' in ret.get('data', {}):
                        self.exit(ret['data']['retcode'])
                finally:
                    salt.utils.profile.output_profile(
                        pr,
                        stats_path=self.options.profiling_path,
                        stop=True)

        except SaltClientError as exc:
            raise SystemExit(six.text_type(exc))
1252722
def _get_all_run_infos(self):
    """"""
    info_dir = self._settings.info_dir
    if not os.path.isdir(info_dir):
      return []
    paths = [os.path.join(info_dir, x) for x in os.listdir(info_dir)]

    # We copy the RunInfo as a dict, so we can add stuff to it to pass to the template.
    # We filter only those that have a timestamp, to avoid a race condition with writing
    # that field.
    return [d for d in
            [RunInfo(os.path.join(p, 'info')).get_as_dict() for p in paths
             if os.path.isdir(p) and not os.path.islink(p)]
            if 'timestamp' in d]