Check whether Turbo Boost (scaling CPU frequency beyond nominal frequency)
    is active on this system.
    @return: A bool, or None if Turbo Boost is not supported.
515211
def is_turbo_boost_enabled():
    
    try:
        if os.path.exists(_TURBO_BOOST_FILE):
            boost_enabled = int(util.read_file(_TURBO_BOOST_FILE))
            if not (0 <= boost_enabled <= 1):
                raise ValueError('Invalid value {} for turbo boost activation'.format(boost_enabled))
            return boost_enabled != 0
        if os.path.exists(_TURBO_BOOST_FILE_PSTATE):
            boost_disabled = int(util.read_file(_TURBO_BOOST_FILE_PSTATE))
            if not (0 <= boost_disabled <= 1):
                raise ValueError('Invalid value {} for turbo boost activation'.format(boost_enabled))
            return boost_disabled != 1
    except ValueError as e:
        sys.exit("Could not read turbo-boost information from kernel: {0}".format(e))
956723
def rw_active(self):
        """"""
        result = False
        for disk in self.disks:
            result = disk.rw_active() or result
        return result
440112
def is_gpu(self):
        
        return self._device.get_info(cl.device_info.TYPE) == cl.device_type.GPU
362498
def available_freq():
    
    _file = open(CPU_PREFIX + 'cpu0/cpufreq/scaling_available_frequencies')

    freq = [int(_file) for _file in _file.read().strip().split()]

    _file.close()

    return freq
896259
def power_up(self):
        
        GPIO.output(self._pd_sck, False)
        time.sleep(0.01)
        return True
1024890
def is_enabled():
    
    output = subprocess.check_output(['ufw', 'status'],
                                     universal_newlines=True,
                                     env={'LANG': 'en_US',
                                          'PATH': os.environ['PATH']})

    m = re.findall(r'^Status: active\n', output, re.M)

    return len(m) >= 1
1095179
public boolean isModified(boolean isAsync)
  {
    long now = CurrentTime.currentTime();

    if (now < _checkExpiresTime)
      return _isModified;
    
    if (_isChecking.getAndSet(true))
      return _isModified;
    
    _checkExpiresTime = now + _checkInterval;

    if (isAsync) {
      getWorker().wake();
    }
    else {
      try {
        checkImpl();
      } finally {
        _isChecking.set(false);
      }
    }

    return _isModified;
  }
1098322
def _get_cpu_info_from_cpufreq_info():
	'''
	
	'''
	try:
		hz_brand, scale = '0.0', 0

		if not DataSource.has_cpufreq_info():
			return {}

		returncode, output = DataSource.cpufreq_info()
		if returncode != 0:
			return {}

		hz_brand = output.split('current CPU frequency is')[1].split('\n')[0]
		i = hz_brand.find('Hz')
		assert(i != -1)
		hz_brand = hz_brand[0 : i+2].strip().lower()

		if hz_brand.endswith('mhz'):
			scale = 6
		elif hz_brand.endswith('ghz'):
			scale = 9
		hz_brand = hz_brand.rstrip('mhz').rstrip('ghz').strip()
		hz_brand = _to_decimal_string(hz_brand)

		info = {
			'hz_advertised_friendly' : _hz_short_to_friendly(hz_brand, scale),
			'hz_actual_friendly' : _hz_short_to_friendly(hz_brand, scale),
			'hz_advertised' : _hz_short_to_full(hz_brand, scale),
			'hz_actual' : _hz_short_to_full(hz_brand, scale),
		}

		info = {k: v for k, v in info.items() if v}
		return info
	except:
		#raise # NOTE: To have this throw on error, uncomment this line
		return {}
209750
def isLocked( self ):
        
        # return if the layer is not the current layer
        if self._layer and not self._layer.isCurrent():
             return True
        
        # return whether or not the node is enabld or locked
        return not self._enabled or (self._xLocked and self._yLocked)
253729
def is_active(self):
    
    return bool(
        self._grpc_port is not None and
        self._event_multiplexer and
        self._event_multiplexer.PluginRunToTagToContent(
            constants.DEBUGGER_PLUGIN_NAME))
613440
public boolean isPushSupported() {
    String version = android.os.Build.VERSION.RELEASE.substring(0, 3);
    return (Double.valueOf(version) >= MIN_SUPPORTED_ANDRIOD_VERSION);
  }
331341
def _supports_avx():
    """"""
    if os.path.exists("/proc/cpuinfo"):
        with open("/proc/cpuinfo") as in_handle:
            for line in in_handle:
                if line.startswith("flags") and line.find("avx") > 0:
                    return True
1124568
def is_running(self) -> bool:
        """"""
        return (
            self._has_started and
            self.is_alive() or
            self.completed_at is None or
            (datetime.utcnow() - self.completed_at).total_seconds() < 0.5
        )
1078787
def is_openmp_supported():
    
    log_threshold = log.set_threshold(log.FATAL)
    ret = check_openmp_support()
    log.set_threshold(log_threshold)
    return ret
339979
def is_running(self):
        
        for node in self._nodes.values():
            # Some node type are always running we ignore them
            if node.status != "stopped" and not node.is_always_running():
                return True
        return False
125230
def still_optimizing(self):
        """"""

        # Check if we need to give up on optimizing.
        if (self.iterations > self.max_iter) or (self.time_elapsed() > self.max_time):
            return False

        # Always optimize for at least 'min_iter' iterations.
        elif not hasattr(self, 'improvement') or (self.iterations < self.min_iter):
            return True

        # Check convergence.
        else:
            self.converged = self.improvement < self.tol
            return False if self.converged else True
237816
def IsAllocated(self):
    
    if self._stat_object is None:
      self._stat_object = self._GetStat()
    return self._stat_object and self._stat_object.is_allocated