Checks if a worker is carrying vespene.
489716
def is_carrying_vespene(self) -> bool:
        
        return any(
            buff.value in self._proto.buff_ids
            for buff in {
                BuffId.CARRYHARVESTABLEVESPENEGEYSERGAS,
                BuffId.CARRYHARVESTABLEVESPENEGEYSERGASPROTOSS,
                BuffId.CARRYHARVESTABLEVESPENEGEYSERGASZERG,
            }
        )
1351167
def _get_worker_id(self, conn):
        """"""
        if self._worker_id is None:
            self._worker_id = conn.incr(self._key_worker())
        return self._worker_id
547982
public function has()
    {
        if (!Request::has('position')) {
            return false;
        }

        if (isset($this->item->position)) {
            return true;
        }

        if (!empty($this->pivot) && isset($this->pivot->position)) {
            return true;
        }

        return false;
    }
729007
def hasnew(self,allowempty=False):
        """"""
        for e in  self.select(New,None,False, False):
            if not allowempty and len(e) == 0: continue
            return True
        return False
1024216
void ensurePrestart() {
        int wc = workerCountOf(ctl.get());
        if (wc < corePoolSize)
            addWorker(null, true);
        else if (wc == 0)
            addWorker(null, false);
    }
1229037
function () {
                    //Check if any input was added dynamically
                    if (job.input.length > 0) {
                        job.is_complete = false;
                        return false;
                    }

                    //Wait for workers or instances that are still working
                    return worker_count > 0 ? areWorkersComplete() : job.instances <= 0;
                }
364826
def filter_workers(self, request, context):
        """"""
        _log_request(request, context)
        workers_pattern, workers_negate = PATTERN_PARAMS_OP(request.workers_filter)

        hregex = re.compile(workers_pattern)  # hostname filter condition

        def hcondition(worker):
            return accepts(hregex, workers_negate, worker.hostname)  # pragma: no branch

        found_workers = (worker for worker in
                         sorted(self.listener.memory.workers.values(),
                                key=WORKER_HOSTNAME_OP)
                         if hcondition(worker))

        def callback(t):
            logger.debug('%s iterated %d workers in %s (%s)', self.filter_workers.__name__,
                         t.count, t.duration_human, t.throughput_human)

        for worker in about_time(callback, found_workers):
            yield ClearlyServer._event_to_pb(worker)[1]
924229
function () {
		var wsKeys = Object.keys( this.workerDescription.workerSupports );
		return ( ( this.instructionQueue.length > 0 && this.instructionQueuePointer < this.instructionQueue.length ) || wsKeys.length > 0 );
	}
251434
def _contains(self, item):
        
        if self is item:
            return True
        for m in self.modules:
            if item in m:
                return True
        for p in self.packages:
            if item in p:
                return True
        return False
1334834
public boolean isSlotOccupied(WorkerSlot slot) {
        for (SchedulerAssignment assignment : this.assignments.values()) {
            if (assignment.isSlotOccupied(slot)) {
                return true;
            }
        }

        return false;
    }
84471
function(worker) {
      var data = getWorkerNamespacedData(worker);

      Object.keys(data.pending).forEach(function(seqNum) {
        var item = data.pending[seqNum];
        delete data.pending[seqNum];
        if (item[0].monitored) {
          item[1](new Error("Undeliverable message: worker died before we could get acknowledgement"));
        }
      });
    }
746235
def hascurrent(self, allowempty=False):
        """"""
        for e in self.select(Current,None,False, False):
            if not allowempty and len(e) == 0: continue
            return True
        return False
771303
boolean pred(final WorkItem w) {
	if (w.dev == PollThread.dev_to_del) {
	    if (w.type == PollThread.type_to_del) {
		return w.name.equals(PollThread.name_to_del);
	    } else {
		return false;
	    }
	} else {
	    return false;
	}
    }
137960
def _check(user, topic):
    
    # if export_control then check the team is associated to the product, ie.:
    #   - the current user belongs to the product's team
    #   OR
    #   - the product's team belongs to the user's parents teams
    if topic['export_control']:
        product = v1_utils.verify_existence_and_get(topic['product_id'],
                                                    models.PRODUCTS)
        return (user.is_in_team(product['team_id']) or
                product['team_id'] in user.parent_teams_ids)
    return False
367941
async def verify_worker_impls(chain):
    
    valid_worker_impls = get_valid_worker_impls()
    for obj in chain.get_all_links_in_chain():
        worker_impl = obj.worker_impl
        log.info("Verifying {} {} as a {} task...".format(obj.name, obj.task_id, worker_impl))
        # Run tests synchronously for now.  We can parallelize if efficiency
        # is more important than a single simple logfile.
        await valid_worker_impls[worker_impl](chain, obj)
1006619
def __verify_job_has_started(self):
        """"""
        # Verify that the job started
        self.__get_job()

        # Verify that the pod started
        pods = self.__get_pods()

        assert len(pods) > 0, "No pod scheduled by " + self.uu_name
        for pod in pods:
            status = pod.obj['status']
            for cont_stats in status.get('containerStatuses', []):
                if 'terminated' in cont_stats['state']:
                    t = cont_stats['state']['terminated']
                    err_msg = "Pod %s %s (exit code %d). Logs: `kubectl logs pod/%s`" % (
                        pod.name, t['reason'], t['exitCode'], pod.name)
                    assert t['exitCode'] == 0, err_msg

                if 'waiting' in cont_stats['state']:
                    wr = cont_stats['state']['waiting']['reason']
                    assert wr == 'ContainerCreating', "Pod %s %s. Logs: `kubectl logs pod/%s`" % (
                        pod.name, wr, pod.name)

            for cond in status.get('conditions', []):
                if 'message' in cond:
                    if cond['reason'] == 'ContainersNotReady':
                        return False
                    assert cond['status'] != 'False', \
                        "[ERROR] %s - %s" % (cond['reason'], cond['message'])
        return True
129426
@Override
    public Promise<FileSystemProps> fsProps(String path) {
        return adapter.toPromise(handler -> vertx.fileSystem().fsProps(path, handler));
    }