Returns True if work piece is unclaimed.
436392
def is_unclaimed(work):
  """"""
  if work['is_completed']:
    return False
  cutoff_time = time.time() - MAX_PROCESSING_TIME
  if (work['claimed_worker_id'] and
      work['claimed_worker_start_time'] is not None
      and work['claimed_worker_start_time'] >= cutoff_time):
    return False
  return True
866259
def _is_billing_complete(self):
        
        if self.is_one_off():
            return self.get_billed_amount() >= Balance(self.fixed_amount, self.currency)
        else:
            return False
384874
public function isSuspended()
	{
		if ($this->suspended and $this->suspended_at)
		{
			$this->removeSuspensionIfAllowed();
			return (bool) $this->suspended;
		}

		return false;
	}
880567
private void validateClusterNameOfWorkItem( long woitRefNum ){
        WorkItem woit = workItemDao.findByRefNum( woitRefNum );
        validateClusterNameOfWorkflowInstance( woit.getWoinRefNum() );
    }
686585
public boolean isDue() {
        // user opted out. no data collection.
        if(!Jenkins.getInstance().isUsageStatisticsCollected() || DISABLED)     return false;
        
        long now = System.currentTimeMillis();
        if(now - lastAttempt > DAY) {
            lastAttempt = now;
            return true;
        }
        return false;
    }
464798
def pending_work_items(self):
        ""
        pending = self._conn.execute(
            "SELECT * FROM work_items WHERE job_id NOT IN (SELECT job_id FROM results)"
        )
        return (_row_to_work_item(p) for p in pending)
206335
def CheckTaskToMerge(self, task):
    
    with self._lock:
      is_abandoned = task.identifier in self._tasks_abandoned
      is_processing = task.identifier in self._tasks_processing
      is_queued = task.identifier in self._tasks_queued

      if not is_queued and not is_processing and not is_abandoned:
        raise KeyError('Status of task {0:s} is unknown.'.format(
            task.identifier))

      return is_queued or is_processing or is_abandoned and not task.has_retry
481940
def has_completed(self):
        """"""
        objects_in_db = WorkflowObjectModel.query.filter(
            WorkflowObjectModel.id_workflow == self.uuid,
            WorkflowObjectModel.id_parent == None,  # noqa
        ).filter(WorkflowObjectModel.status.in_([
            workflow_object_class.known_statuses.COMPLETED
        ])).count()
        return objects_in_db == len(list(self.objects))
977236
public boolean isSet() {
        if (isUsageMode()) {
            return true;
        }
        if (getJobFile() != null) {
            return true;
        }
        if (getListType() != null) {
            return true;
        }
        return false;
    }
1336962
def check_hook_mechanism_is_intact(module):
    
    result = True
    if check_register_present(module):
        result = not result
    if check_deregister_present(module):
        result = not result
    return result
614791
def check_recovery(working_dir):
    
    recovery_start_block, recovery_end_block = get_recovery_range(working_dir)
    if recovery_start_block is not None and recovery_end_block is not None:
        local_current_block = virtualchain_hooks.get_last_block(working_dir)
        if local_current_block <= recovery_end_block:
            return True

        # otherwise, we're outside the recovery range and we can clear it
        log.debug('Chain state is at block {}, and is outside the recovery window {}-{}'.format(local_current_block, recovery_start_block, recovery_end_block))
        clear_recovery_range(working_dir)
        return False

    else:
        # not recovering
        return False
1373815
def has_saved(self, addr):
        """"""
        saved = False
        if self._saved_devices.get(addr, None) is not None:
            saved = True
        return saved
459379
public static boolean isRegistered(@Nonnull Item item) {
        ItemDeletion instance = instance();
        if (instance == null) {
            return false;
        }
        instance.lock.readLock().lock();
        try {
            return instance.registrations.contains(item);
        } finally {
            instance.lock.readLock().unlock();
        }
    }
1063218
private boolean isTaskRunning(TaskStatus taskStatus) {
    TaskStatus.State state = taskStatus.getRunState();
    return (state == State.RUNNING || state == State.UNASSIGNED || 
            taskStatus.inTaskCleanupPhase());
  }
461964
function checkCollabAuthenticated(req, res, next) {
		if (req.user) {
			req.user.workspaceDir = options.workspaceDir + (req.user.workspace ? "/" + req.user.workspace : "");
			next();
		} else if (req.headers['authorization'] && checkCollabServerToken(req.headers['authorization'])){
			next();
		} else {
			api.writeError(401, res, "Not authenticated");
		}
	}
372248
def is_current_manager_equals_to(cls, pm):
        """"""
        if hasattr(cls, 'works_result'):
            return cls.works_result
        is_ok = bool(cls._try_get_current_manager() == pm)
        setattr(cls, 'works_result', is_ok)
        return is_ok
534522
private boolean isWorkAvailable() throws SIConnectionDroppedException {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "isWorkAvailable");
      final boolean isWork;
      if (terminate) {
         isWork = false;
      } else {
         isWork = (partiallySentTransmission != null) || !priorityQueue.isEmpty();
      }
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "isWorkAvailable", Boolean.valueOf(isWork));
      return isWork;
   }