Returns true of scanning actually was started, false if it did not need to be
775671
private boolean restartScanning() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            mScanHelper.stopAndroidOBackgroundScan();
        }
        long scanPeriod = mScanState.getBackgroundMode() ? mScanState.getBackgroundScanPeriod() : mScanState.getForegroundScanPeriod();
        long betweenScanPeriod = mScanState.getBackgroundMode() ? mScanState.getBackgroundBetweenScanPeriod() : mScanState.getForegroundBetweenScanPeriod();
        if (mScanHelper.getCycledScanner() != null) {
            mScanHelper.getCycledScanner().setScanPeriods(scanPeriod,
                    betweenScanPeriod,
                    mScanState.getBackgroundMode());
        }
        mInitialized = true;
        if (scanPeriod <= 0) {
            LogManager.w(TAG, "Starting scan with scan period of zero.  Exiting ScanJob.");
            if (mScanHelper.getCycledScanner() != null) {
                mScanHelper.getCycledScanner().stop();
            }
            return false;
        }

        if (mScanHelper.getRangedRegionState().size() > 0 || mScanHelper.getMonitoringStatus().regions().size() > 0) {
            if (mScanHelper.getCycledScanner() != null) {
                mScanHelper.getCycledScanner().start();
            }
            return true;
        }
        else {
            if (mScanHelper.getCycledScanner() != null) {
                mScanHelper.getCycledScanner().stop();
            }
            return false;
        }
    }
1262100
public boolean checkCleanStart() {
        String fwClean = get(BootstrapConstants.INITPROP_OSGI_CLEAN);
        if (fwClean != null && fwClean.equals(BootstrapConstants.OSGI_CLEAN_VALUE)) {
            return true;
        }

        String osgiClean = get(BootstrapConstants.OSGI_CLEAN);
        return Boolean.valueOf(osgiClean);
    }
449154
public function was_started() {

        if ($this->started === null) {
            if ($this->get_start() === 0 || $this->now < $this->get_start()) {
                // Not yet started.
                $this->started = false;
            } else {
                $this->started = true;
            }
        }

        return $this->started;
    }
582022
def _startstop_bool(startb, stopb, runflag, stopextend):
    
    # All false at start
    res = np.zeros(len(startb)) == True  # NOQA

    start_slices = slicelist(startb)
    stop_slices = slicelist(stopb)

    # Special case when there is a start but no stop slice or vice versa:
    # if start_slices and not stop_slices:
    if runflag == 'startonly':
        try:
            start = start_slices[0]
            # Make True from first start and rest of array.
            res[start.start:] = True
            return res
        except IndexError:
            # Only start specified but no start condition
            # fullfilled. Return all False.
            return res

    elif runflag == 'stoponly':
        try:
            stop = stop_slices[0]
            res[:stop.start + stopextend] = True  # Make True up to first stop.
            return res
        except IndexError:
            # Only stop specified but no stop condition fullfilled
            # Return all True
            return res == False  # NOQA

    stop = slice(0, 0)           # For first check
    start = slice(0, 0)          # For a possibly empty list start_slices.
    for start in start_slices:
        if start.start < stop.start:
            continue
        for stop in stop_slices:
            if stop.start > start.start:
                res[start.start: stop.start + stopextend] = True
                break           # Next start
        else:
            # On a given start slice, the entire list of stop slices was
            # exhausted, none being later than the given start. It must mean
            # that from this given start, the rest is to be True:
            break

    # There was no stop for the last start in loop
    if start.start > stop.start:
        res[start.start:] = True

    return res
1165574
public boolean isAsyncStarted(ServletRequest request) {

        if (isAsyncStartedMethod != null) {
            try {
                return (Boolean) isAsyncStartedMethod.invoke(request);
            } catch (IllegalAccessException e) {
                ServletLogger.LOG.error(e);
                return false;
            } catch (InvocationTargetException e) {
                ServletLogger.LOG.error(e);
                return false;
            }
        } else {
            return false;
        }
    }
1326937
def isHeld(self):
        '''
            
        '''
        if not os.path.exists(self.lockPath):
            return False
        
        try:
            mtime = os.stat(self.lockPath).st_mtime
        except FileNotFoundError as e:
            return False
        
        if self.__checkExpiration(mtime):
            return False

        return True
1135858
private void ensureNext() {
        // Check if the current scan result has more keys (i.e. the index did not reach the end of the result list)
        if (resultIndex < scanResult.getResult().size()) {
            return;
        }
        // Since the current scan result was fully iterated,
        // if there is another cursor scan it and ensure next key (recursively)
        if (!FIRST_CURSOR.equals(scanResult.getStringCursor())) {
            scanResult = scan(scanResult.getStringCursor(), scanParams);
            resultIndex = 0;
            ensureNext();
        }
    }
980290
private void cancelScan() {
        if (cleanTask != null) {
            cleanTask.cancel(true);
            cleanTask = null;
        }
        client.close();
    }
465798
def pause_scan(scan_id)
      r = execute(make_xml('ScanPauseRequest', 'scan-id' => scan_id))
      r.success ? r.attributes['success'] == '1' : false
    end
1324366
private boolean okayToSendServerStarted() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "okayToSendServerStarted", this);

        synchronized (lockObject) {
            if (!_sentServerStarted) {
                if ((_state == STATE_STARTED) && _mainImpl.isServerStarted()) {
                    _sentServerStarted = true;
                }
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "okayToSendServerStarted", new Boolean(_sentServerStarted));
        return _sentServerStarted;
    }
1201076
def __IsInitialized(self):      
      
    is_initialized = False
    iam_id = self.GetAccessKeyId()
    if iam_id:
      if core.CirrusAccessIdMetadata(self.s3, iam_id).IsInitialized():
        is_initialized = True
    return is_initialized
610287
protected boolean doStart()
  {
    if (! _lifecycle.isActive()) {
      return false;
    }
    
    if (! isEnable()) {
      return false;
    }
    
    int startingCount = _startingCount.getAndIncrement();

    int threadCount = _threadCount.get() + startingCount;

    if (_threadMax < threadCount) {
      _startingCount.decrementAndGet();
      
      onThreadMax();
      
      return false;
    }
    else if (isIdleTooLow(startingCount)) {
      return true;
    }
    else {
      _startingCount.decrementAndGet();
      
      return false;
    }
  }
733145
def is_active(self):
        
        start = self.start_date()
        return not self.is_completed() and (not start or start <= date.today())
239021
def triggered(self):
        
        if self.stop is not None and not self.stop_reached:
            return False

        if self.limit is not None and not self.limit_reached:
            return False

        return True
105308
def is_running(self):
        
        return self._process.state() in [self._process.Running, self._process.Starting]
849465
def stop_scan_request(self):
        ''''''
        command=HCI_Cmd_LE_Scan_Enable(False,False)
        self.transport.write(command.encode())
511565
def _on_process_started(self):
        
        comm('backend process started')
        if self is None:
            return
        self.starting = False
        self.running = True