Checks if a worker or MULE is carrying (gold-)minerals.
964341
def is_carrying_minerals(self) -> bool:
        
        return any(
            buff.value in self._proto.buff_ids
            for buff in {BuffId.CARRYMINERALFIELDMINERALS, BuffId.CARRYHIGHYIELDMINERALFIELDMINERALS}
        )
39432
def contains(path, text):
    '''
    
    '''
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    stripped_text = six.text_type(text).strip()
    try:
        with salt.utils.filebuffer.BufferedReader(path) as breader:
            for chunk in breader:
                if stripped_text in chunk:
                    return True
        return False
    except (IOError, OSError):
        return False
1007827
def CheckTotals(self):
        """"""
        staves = self.GetChildrenIndexes()
        for staff in staves:
            child = self.getStaff(staff)
            child.CheckTotals()
71668
def verify(self, checksum=None, token=None, full_response=False):
        """"""
        payload = {"checksum":checksum, "a":"verify"}
        if token:
            payload.update({"token":token})
        return self.get_shards(Shard(**payload), full_response=True)
1237772
function isWearable (attributes, index) {
        if (index >= attributes.inventory.length) {
            throw new InventoryIndexError(index);
        }

        var item = attributes.inventory[index];

        if (!requirements.met(attributes, item.requirements)) {
            throw new RequirementsNotMetError();
        }

        var slotName = item.slot;

        if (!slotName) {
            throw new UnequippableItemError(item.name);
        }

        return slotName;
    }
206064
def has_role(self, role_or_handle):
        
        if not isinstance(role_or_handle, str):
            return role_or_handle in self.roles

        has_role = False
        for role in self.roles:
            if role.handle == role_or_handle:
                has_role = True
                break

        return has_role
1024888
public function isGreater(Money $a, Money $b) : bool
    {
        return $this->compare($a, $b) > 0;
    }
736746
def _mine(self, load):
        '''
        
        '''
        load = self.__verify_load(load, ('id', 'data', 'tok'))
        if load is False:
            return {}
        return self.masterapi._mine(load, skip_verify=True)
259629
def isin(elems, line):
    
    found = False
    for e in elems:
        if e in line.lower():
            found = True
            break
    return found
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)
809044
def IsAllSpent(self):
        
        for item in self.Items:
            if item == CoinState.Confirmed:
                return False
        return True
21299
function IS($action,$module,$bundle,$output){
		$match = true;

		if($action != '' && $action != $this->action ){
			$match = false;
		}
		if($module != '' && $module != $this->module ){
			$match = false;
		}
		if($bundle != '' && $bundle != $this->bundle ){
			$match = false;
		}
		if($match){
			return $output;
		}
		return '';
	}
706988
public function isWorker($worker_id = null)
    {
        if ($worker_id == null) {
            $worker_id = $this->workerId;
        }
        return $worker_id < $this->worker_num ? true : false;
    }
510547
def _mine_get(self, load):
        '''
        
        '''
        load = self.__verify_load(load, ('id', 'tgt', 'fun', 'tok'))
        if load is False:
            return {}
        else:
            return self.masterapi._mine_get(load, skip_verify=True)
729385
def has_roles?(*args)
      throw Exception.new("Must supply at least one role.") if args.empty?
      roles.where(name: args).count == args.count
    end
323094
def _check_outcome(self, jobs):
        """"""
        if self.skip:
            return False

        if not jobs:
            logger.error("Import failed!")
            return False

        failed_jobs = []
        for job in jobs:
            status = job.get("status")
            if not status:
                failed_jobs.append(job)
                continue

            if status.lower() != "success":
                failed_jobs.append(job)

        for job in failed_jobs:
            logger.error("job: %s; status: %s", job.get("id"), job.get("status"))
        if len(failed_jobs) == len(jobs):
            logger.error("Import failed!")
        elif failed_jobs:
            logger.error("Some import jobs failed!")
        else:
            logger.info("Results successfully updated!")

        return not failed_jobs
1319002
def check(self, datas, *filers):
        '''
            
        '''
        # special case : no filter : want to read all the feed
        if self.match == "" and self.does_not_match == '':
            yield datas
        # let's filtering :
        else:
            condition1 = False
            condition2 = False
            # arg contain the property from which we want to check the 'data'
            for prop in filers:
                # check if my datas contains my property
                if prop in datas:
                    # filter to find only this data
                    if self.match != '' and condition1 is False:
                        condition1 = self.filter_that(self.match,
                                                      datas[prop])
                    # filter to exclude this data,
                    # when found, continue to the next entry
                    if self.does_not_match != '' and condition2 is False:
                        condition2 = self.filter_that(self.does_not_match,
                                                      datas[prop])
                        if condition2:
                            continue
        if condition1 and condition2 is False:
            yield datas