GET method implementation for list view
        job_id -- Mandatory filter indicating which job these log belongs to.
506245
def list(self, request, project):
        
        job_ids = request.query_params.getlist('job_id')
        if not job_ids:
            raise ParseError(
                detail="The job_id parameter is mandatory for this endpoint")
        try:
            job_ids = [int(job_id) for job_id in job_ids]
        except ValueError:
            raise ParseError(detail="The job_id parameter(s) must be integers")

        logs = JobLog.objects.filter(job__repository__name=project,
                                     job_id__in=job_ids)

        return Response([self._log_as_dict(log) for log in logs])
999402
@Override
  public List<TaskStatusEvent> getJobHistory(final JobId jobId, final String host)
      throws JobDoesNotExistException {
    final Job descriptor = getJob(jobId);
    if (descriptor == null) {
      throw new JobDoesNotExistException(jobId);
    }
    final ZooKeeperClient client = provider.get("getJobHistory");
    final List<String> hosts;

    try {
      hosts = (!isNullOrEmpty(host)) ? singletonList(host) :
              client.getChildren(Paths.historyJobHosts(jobId));
    } catch (NoNodeException e) {
      return emptyList();
    } catch (KeeperException e) {
      throw new RuntimeException(e);
    }

    final List<TaskStatusEvent> jsEvents = Lists.newArrayList();

    for (final String h : hosts) {
      final List<String> events;
      try {
        events = client.getChildren(Paths.historyJobHostEvents(jobId, h));
      } catch (NoNodeException e) {
        continue;
      } catch (KeeperException e) {
        throw new RuntimeException(e);
      }

      for (final String event : events) {
        try {
          final byte[] data = client.getData(Paths.historyJobHostEventsTimestamp(
              jobId, h, Long.valueOf(event)));
          final TaskStatus status = Json.read(data, TaskStatus.class);
          jsEvents.add(new TaskStatusEvent(status, Long.valueOf(event), h));
        } catch (NoNodeException e) { // ignore, it went away before we read it
        } catch (KeeperException | IOException e) {
          throw new RuntimeException(e);
        }
      }
    }

    return Ordering.from(EVENT_COMPARATOR).sortedCopy(jsEvents);
  }
1022589
def job(self, job_id):
        
        path = '/ws/v1/history/mapreduce/jobs/{jobid}'.format(jobid=job_id)

        return self.request(path)
916702
def list(context, job_id):
    

    result = analytic.list(context, job_id=job_id)
    utils.format_output(result, context.format)
1085997
def get_job_model(self):
        
        if not self.job:
            raise Exception('Job not loaded yet. Use load(id) first.')

        return JobModel(self.job_id, self.job, self.home_config['storage_dir'])
43787
int findIndex(final Job job) {
        int size = jobList.size();
        boolean found = false;

        int i = 0;
        for (; i < size; i++) {
            ScheduledJobEntry se = (ScheduledJobEntry) jobList.get(i);
            if (se.job == job) {
                found = true;
                break;
            }
        }
        if (found) {
            return i;
        } else {
            return -1;
        }
    }
905043
def get_logs(self, jobs, log_file=None):
        """"""
        if not (jobs and self.log_url):
            return

        for job in jobs:
            url = "{}?jobId={}".format(self.log_url, job.get("id"))
            if log_file:
                self._download_log("{}&download".format(url), log_file)
            else:
                logger.info("Submit log for job %s: %s", job.get("id"), url)
1154904
def _list_contents(self, last_obj=None, single_page_return=False):
        
        if self.job_args.get('cdn_containers'):
            if not self.job_args.get('fields'):
                self.job_args['fields'] = [
                    'name',
                    'cdn_enabled',
                    'log_retention',
                    'ttl'
                ]
            url = self.job_args['cdn_storage_url']
        else:
            url = self.job_args['storage_url']

        objects_list = self.job.list_items(
            url=url,
            container=self.job_args['container'],
            last_obj=last_obj,
            spr=single_page_return
        )

        pattern_match = self.job_args.get('pattern_match')
        if pattern_match:
            self.match_filter(
                idx_list=objects_list,
                pattern=pattern_match,
                dict_type=True
            )

        LOG.debug('List of objects: "%s"', objects_list)
        return objects_list
935697
def list(self, id=None):
        
        args = {'id': id}
        self._job_chk.check(args)
        return self._client.json('job.list', args)
754620
def GetBatchJob(client, batch_job_id):
  
  batch_job_service = client.GetService('BatchJobService', 'v201809')

  selector = {
      'fields': ['Id', 'Status', 'DownloadUrl'],
      'predicates': [
          {
              'field': 'Id',
              'operator': 'EQUALS',
              'values': [batch_job_id]
          }
      ]
  }

  return batch_job_service.get(selector)['entries'][0]
602669
public Optional<JobDefinition> getJobDefinition(final String jobType) {
        return jobDefinitions
                .stream()
                .filter((j) -> j.jobType().equalsIgnoreCase(jobType))
                .findAny();
    }
199015
def getnjobs(self, key, **kwargs):
        

        return self.get(key, cast_func=parse_n_jobs, **kwargs)
949614
def getJobInfo(self, jobId):
        
        job = self._jtracker.getJobInfo(jobId)
        if job is not None:
            return SparkJobInfo(jobId, job.stageIds(), str(job.status()))
1259767
public Map<String, Job> getJobs(String view) throws IOException {
        return getJobs(null, view);
    }
775092
def trace_job(self, jobId):
        
        header = self.__check_authentication()
        status_url = self.address + "/jobs/" + jobId + "/trace"
        status_resp = requests.get(status_url, headers=header)
        if status_resp.status_code != 200:
            raise ValueError("Code {}. {}".format(status_resp.status_code, status_resp.json().get("error")))
        return status_resp.json()
1062737
def job(project_id, job_id, opts = {})
      data, _status_code, _headers = job_with_http_info(project_id, job_id, opts)
      return data
    end
372497
def get_job_id(self, response):
        """"""
        lines = [line.strip() for line in response.split("\n")
                if line.strip() != '']
        last_line = lines[-1]
        match = re.match('(\d+)\.[\w.-]+$', last_line)
        if match:
            return match.group(1)
        else:
            return None