Deprecated - Use get_next_job
323737
def get_next_job_by_port(plugin_name, port, verify_job=True, conn=None):
    
    return get_next_job(plugin_name, None, port, verify_job, conn)
1276922
def fetch_next_page(self):
        
        for page in self:
            return page
        else:
            return Page(self._resultset.cursor, iter(()))
1193248
def get_jobs(when=None, only_scheduled=False):
    
    # FIXME: HACK: make sure the project dir is on the path when executed as ./manage.py
    try:
        cpath = os.path.dirname(os.path.realpath(sys.argv[0]))
        ppath = os.path.dirname(cpath)
        if ppath not in sys.path:
            sys.path.append(ppath)
    except Exception:
        pass
    _jobs = {}

    for app_name in [app.name for app in apps.get_app_configs()]:
        scandirs = (None, 'minutely', 'quarter_hourly', 'hourly', 'daily', 'weekly', 'monthly', 'yearly')
        if when:
            scandirs = None, when
        for subdir in scandirs:
            try:
                path = find_job_module(app_name, subdir)
                for name in find_jobs(path):
                    if (app_name, name) in _jobs:
                        raise JobError("Duplicate job %s" % name)
                    job = import_job(app_name, name, subdir)
                    if only_scheduled and job.when is None:
                        # only include jobs which are scheduled
                        continue
                    if when and job.when != when:
                        # generic job not in same schedule
                        continue
                    _jobs[(app_name, name)] = job
            except ImportError:
                # No job module -- continue scanning
                pass

    return _jobs
197594
def get_jobs(plugin_name,
             verify_job=True, conn=None):
    
    job_cur = _jobs_cursor(plugin_name).run(conn)
    for job in job_cur:
        if verify_job and not verify(job, Job()):
            continue #to the next job... warn?
        yield job
961071
def _run_tool(job_name, t, fastafile, params):
    """"""
    try:
        result = t.run(fastafile, params, mytmpdir())
    except Exception as e:
        result = ([], "", "{} failed to run: {}".format(job_name, e))
    
    return job_name, result
698249
def _get_next_positional(self):
        
        active_parser = self.active_parsers[-1]
        last_positional = self.visited_positionals[-1]

        all_positionals = active_parser._get_positional_actions()
        if not all_positionals:
            return None

        if active_parser == last_positional:
            return all_positionals[0]

        i = 0
        for i in range(len(all_positionals)):
            if all_positionals[i] == last_positional:
                break

        if i + 1 < len(all_positionals):
            return all_positionals[i + 1]

        return None
772100
def next(self):
        
        if self._selfiter is None:
            warnings.warn(
                "Calling 'next' directly on a query is deprecated. "
                "Perhaps you want to use iter(query).next(), or something "
                "more expressive like store.findFirst or store.findOrCreate?",
                DeprecationWarning, stacklevel=2)
            self._selfiter = self.__iter__()
        return self._selfiter.next()
723676
def _get_jobs_url(self):
        """"""
        if self._jobs_url is None:
            self.get_instance_status()
            if self._jobs_url is None:
                raise ValueError("Cannot obtain jobs URL")
        return self._jobs_url
609628
def get(self, id):
        
        self.cur.execute("SELECT * FROM jobs WHERE hash=?", (id,))
        item = self.cur.fetchone()
        if item:
            return dict(zip(
                ("id", "description", "last-run", "next-run", "last-run-result"),
                item))

        return None
47224
def get_next_job_record(self, process_name):
        
        tree = self.get_tree(process_name)
        node = tree.get_next_node(process_name)

        if node.job_record is None:
            self.assign_job_record(node)
        return node.job_record
501490
private JobStory getNextJobFiltered() throws IOException {
    while (true) {
      ZombieJob job = producer.getNextJob();
      if (job == null) {
        return null;
      }
      if (job.getOutcome() == Pre21JobHistoryConstants.Values.KILLED) {
        continue;
      }
      if (job.getNumberMaps() == 0) {
        continue;
      }
      if (job.getNumLoggedMaps() == 0) {
        continue;
      }
      return job;
    }
  }
342610
def _get_jobs_from_template(self, template, job_class):
        
        jobs = []
        for command in template.eval():
            alias = command.alias
            depends_on = [job.alias
                for job in self.queue.all_jobs
                    for deps in command.depends_on
                        if deps == job.alias]
            command.update_dependent_files([job.command
                for job in self.queue.all_jobs
                    if not isinstance(job, JobTemplate)])

            job = job_class(alias, command, depends_on)
            jobs.append(job)
        return jobs
98109
def get_job_by_id(job_id, conn=None):
    
    job = RBJ.get(job_id).run(conn)
    return job
620396
def get_jobs(self, id=None, params=None):
        
        return self.transport.perform_request(
            "GET", _make_path("_rollup", "job", id), params=params
        )
578353
protected function findNextJob(): ?Job
    {
        $next_at_timestamp = $this->getNextAtTimestamp();
        $cron_id = $this->getNextCronId();

        if (is_null($cron_id)) {
            return $this->getNextAtJob();
        }

        $next_cron_timestamp = $this->getCronTimestamp($cron_id);

        if ($next_at_timestamp <= $next_cron_timestamp) {
            return $this->getNextAtJob();
        }

        return $this->getNextCronJob();
    }
739526
def _get_next_files(self):
        
        fnlist = self.__files[:16]
        self.__files = self.__files[16:]
        return fnlist
1335420
def getTopologicalOrderingOfJobs(self):
        
        ordering = []
        visited = set()
        def getRunOrder(job):
            #Do not add the job to the ordering until all its predecessors have been
            #added to the ordering
            for p in job._directPredecessors:
                if p not in visited:
                    return
            if job not in visited:
                visited.add(job)
                ordering.append(job)
                list(map(getRunOrder, job._children + job._followOns))
        getRunOrder(self)
        return ordering