Job View Helper methods
501783
def class_with_link(job)
      <<-EOS
        <a class='job-link' href="#{job_path(job.id)}">
          <i class="#{job_icon(job)}" style="font-size: 75%" title="#{job_state(job)}"></i>
          #{job.class.name}
        </a>
      EOS
    end
254508
void selectJobsToInitialize() {
    for (String queue : jobQueues.keySet()) {
      ArrayList<JobInProgress> jobsToInitialize = getJobsToInitialize(queue);
      printJobs(jobsToInitialize);
      JobInitializationThread t = threadsToQueueMap.get(queue);
      for (JobInProgress job : jobsToInitialize) {
        t.addJobsToQueue(queue, job);
      }
    }
  }
619482
def gather_job_info(self, jid, tgt, tgt_type, listen=True, **kwargs):
        '''
        
        '''
        log.debug('Checking whether jid %s is still running', jid)
        timeout = int(kwargs.get('gather_job_timeout', self.opts['gather_job_timeout']))

        pub_data = self.run_job(tgt,
                                'saltutil.find_job',
                                arg=[jid],
                                tgt_type=tgt_type,
                                timeout=timeout,
                                listen=listen,
                                **kwargs
                               )

        if 'jid' in pub_data:
            self.event.subscribe(pub_data['jid'])

        return pub_data
1288097
def main_browse():
    
    parser = argparse.ArgumentParser(usage="job_archive.py [options]",
                                     description="Browse a job archive")

    parser.add_argument('--jobs', action='store', dest='job_archive_table',
                        type=str, default='job_archive_temp2.fits', help="Job archive file")
    parser.add_argument('--files', action='store', dest='file_archive_table',
                        type=str, default='file_archive_temp2.fits', help="File archive file")
    parser.add_argument('--base', action='store', dest='base_path',
                        type=str, default=os.path.abspath('.'), help="File archive base path")

    args = parser.parse_args(sys.argv[1:])
    job_ar = JobArchive.build_archive(**args.__dict__)

    job_ar.table.pprint()
1148130
public void generateJobTable(JspWriter out, String label, List<JobInProgress> jobs)
      throws IOException {
    if (jobs.size() > 0) {
      for (JobInProgress job : jobs) {
        JobProfile profile = job.getProfile();
        JobStatus status = job.getStatus();
        JobID jobid = profile.getJobID();

        int desiredMaps = job.desiredMaps();
        int desiredReduces = job.desiredReduces();
        int completedMaps = job.finishedMaps();
        int completedReduces = job.finishedReduces();
        String name = profile.getJobName();

        out.print("<" + label + "_job jobid=\"" + jobid + "\">\n");
        out.print("  <jobid>" + jobid + "</jobid>\n");
        out.print("  <user>" + profile.getUser() + "</user>\n");
        out.print("  <name>" + ("".equals(name) ? "&nbsp;" : name) + "</name>\n");
        out.print("  <map_complete>" + StringUtils.formatPercent(status.mapProgress(), 2) + "</map_complete>\n");
        out.print("  <map_total>" + desiredMaps + "</map_total>\n");
        out.print("  <maps_completed>" + completedMaps + "</maps_completed>\n");
        out.print("  <reduce_complete>" + StringUtils.formatPercent(status.reduceProgress(), 2) + "</reduce_complete>\n");
        out.print("  <reduce_total>" + desiredReduces + "</reduce_total>\n");
        out.print("  <reduces_completed>" + completedReduces + "</reduces_completed>\n");
        out.print("</" + label + "_job>\n");
      }
    }
  }
441346
def all_jobs(self):
        
        from db.models.jobs import Job

        return Job.all.filter(project=self)
171985
def job_data(cls, job_id=dummy_job_id, branches=None, **kwargs):
        
        return dict(job_id=job_id, branches=branches or [])
199015
def getnjobs(self, key, **kwargs):
        

        return self.get(key, cast_func=parse_n_jobs, **kwargs)
1211301
def _view(self, filepath, format):
        """"""
        methodnames = [
            '_view_%s_%s' % (format, backend.PLATFORM),
            '_view_%s' % backend.PLATFORM,
        ]
        for name in methodnames:
            view_method = getattr(self, name, None)
            if view_method is not None:
                break
        else:
            raise RuntimeError('%r has no built-in viewer support for %r '
                'on %r platform' % (self.__class__, format, backend.PLATFORM))
        view_method(filepath)
213571
function (jobName, customParams, callback) {
      [jobName, customParams, callback] = doArgs(arguments, ['string', ['object', {}], 'function']);

      const self = this;

      doRequest({
        method: 'POST',
        urlPattern: [JOB_DISABLE, jobName],
        noparse: true
      }, customParams, function (error, data) {
        if (error) {
          callback(error, data);
          return;
        }
        self.job_info(jobName, customParams, callback);
      });
    }
80364
function() {
    var displayString = '###############################\n' + '###### Current jobs pool ######\n' + '###############################\n';
    var c = 0;
    for (var key in jobsArray) {;
        c++;
        displayString += '# ' + key + ' : ' + jobsArray[key].status + '\n';
    }
    if (c === 0)
        displayString += '          EMPTY               \n';
    console.log(displayString);
    return null;

}
818445
def job_path(cls, project, jobs):
        """"""
        return google.api_core.path_template.expand(
            "projects/{project}/jobs/{jobs}", project=project, jobs=jobs
        )
1016163
def report(args):
  """"""
  jm = setup(args)
  jm.report(job_ids=get_ids(args.job_ids), array_ids=get_ids(args.array_ids), output=not args.errors_only, error=not args.output_only, status=args.status, name=args.name)
778941
private void populate_Job (Hashtable<Enum, String> job, java.util.Map<JobHistory.Keys, String> jobC) throws ParseException {
    int size = jobC.size(); 
    java.util.Iterator<Map.Entry<JobHistory.Keys, String>> kv = jobC.entrySet().iterator();
    for (int i = 0; i < size; i++)
    {
      Map.Entry<JobHistory.Keys, String> entry = (Map.Entry<JobHistory.Keys, String>) kv.next();
      JobHistory.Keys key = entry.getKey();
      String value = entry.getValue();
      //System.out.println("JobHistory.JobKeys."+key+": "+value);
      switch (key) {
      case JOBTRACKERID: job.put(JobKeys.JOBTRACKERID, value); break;
      case FINISH_TIME: job.put(JobKeys.FINISH_TIME, value); break;
      case JOBID: job.put(JobKeys.JOBID, value); break;
      case JOBNAME: job.put(JobKeys.JOBNAME, value); break;
      case USER: job.put(JobKeys.USER, value); break;
      case JOBCONF: job.put(JobKeys.JOBCONF, value); break;
      case SUBMIT_TIME: job.put(JobKeys.SUBMIT_TIME, value); break;
      case LAUNCH_TIME: job.put(JobKeys.LAUNCH_TIME, value); break;
      case TOTAL_MAPS: job.put(JobKeys.TOTAL_MAPS, value); break;
      case TOTAL_REDUCES: job.put(JobKeys.TOTAL_REDUCES, value); break;
      case FAILED_MAPS: job.put(JobKeys.FAILED_MAPS, value); break;
      case FAILED_REDUCES: job.put(JobKeys.FAILED_REDUCES, value); break;
      case FINISHED_MAPS: job.put(JobKeys.FINISHED_MAPS, value); break;
      case FINISHED_REDUCES: job.put(JobKeys.FINISHED_REDUCES, value); break;
      case JOB_STATUS: job.put(JobKeys.STATUS, value); break;
      case JOB_PRIORITY: job.put(JobKeys.JOB_PRIORITY, value); break;
      case COUNTERS:
        value.concat(",");
        parseAndAddJobCounters(job, value);
        break;
      default:   System.err.println("JobHistory.Keys."+key+" : NOT INCLUDED IN PERFORMANCE ADVISOR COUNTERS");
               break;
      }
    }
  }
1130899
def view_for(self, action='view'):
        
        app = current_app._get_current_object()
        view, attr = self.view_for_endpoints[app][action]
        return getattr(view(self), attr)
362102
@Exported(name="property",inline=true)
    public List<JobProperty<? super JobT>> getAllProperties() {
        return properties.getView();
    }
1300429
def _format_job_instance(job):
    '''
    
    '''
    if not job:
        ret = {'Error': 'Cannot contact returner or no job with this jid'}
        return ret

    ret = {'Function': job.get('fun', 'unknown-function'),
           'Arguments': list(job.get('arg', [])),
           # unlikely but safeguard from invalid returns
           'Target': job.get('tgt', 'unknown-target'),
           'Target-type': job.get('tgt_type', 'list'),
           'User': job.get('user', 'root')}

    if 'metadata' in job:
        ret['Metadata'] = job.get('metadata', {})
    else:
        if 'kwargs' in job:
            if 'metadata' in job['kwargs']:
                ret['Metadata'] = job['kwargs'].get('metadata', {})

    if 'Minions' in job:
        ret['Minions'] = job['Minions']
    return ret