Query whether a CPU feature is supported or not.

        in feature of type :class:`ProcessorFeature`
            CPU Feature identifier.

        return supported of type bool
            Feature is supported or not.
176666
def get_processor_feature(self, feature):
        
        if not isinstance(feature, ProcessorFeature):
            raise TypeError("feature can only be an instance of type ProcessorFeature")
        supported = self._call("getProcessorFeature",
                     in_p=[feature])
        return supported
121674
private boolean isProcessInstanceResumable(ProcessInstance pInstance) {

        int statusCd = pInstance.getStatusCode().intValue();
        if (statusCd == WorkStatus.STATUS_COMPLETED.intValue()) {
            return false;
        } else if (statusCd == WorkStatus.STATUS_CANCELLED.intValue()) {
            return false;
        }
        return true;
    }
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 {}
311440
def get_architecture(arch=None):
    
    if arch is None:
        arch = os.environ.get('PROCESSOR_ARCHITEW6432')
        if not arch:
            arch = os.environ.get('PROCESSOR_ARCHITECTURE')
    return SupportedArchitectureMap.get(arch, ArchDefinition('', ['']))
608761
def check_hardware_virtualization(self, source_node):
        

        for project in self._projects.values():
            for node in project.nodes:
                if node == source_node:
                    continue
                if node.hw_virtualization and node.__class__.__name__ != source_node.__class__.__name__:
                    return False
        return True
1215300
boolean containFeature(Map<String, ProvisioningFeatureDefinition> installedFeatures, String feature) {
        if (installedFeatures.containsKey(feature))
            return true;
        for (ProvisioningFeatureDefinition pfd : installedFeatures.values()) {
            String shortName = InstallUtils.getShortName(pfd);
            if (shortName != null && shortName.equalsIgnoreCase(feature))
                return true;
        }
        return false;
    }
1297629
def get_supported(versions=None, supplied_platform=None):
    
    supported = []

    # Versions must be given with respect to the preference
    if versions is None:
        versions = []
        version_info = get_impl_version_info()
        major = version_info[:-1]
        # Support all previous minor Python versions.
        for minor in range(version_info[-1], -1, -1):
            versions.append(''.join(map(str, major + (minor,))))

    impl = get_abbr_impl()

    abis = []

    abi = get_abi_tag()
    if abi:
        abis[0:0] = [abi]

    abi3s = set()
    import imp
    for suffix in imp.get_suffixes():
        if suffix[0].startswith('.abi'):
            abi3s.add(suffix[0].split('.', 2)[1])

    abis.extend(sorted(list(abi3s)))

    abis.append('none')

    platforms = []
    if supplied_platform:
        platforms.append(supplied_platform)
    platforms.append(get_platform())

    # Current version, current API (built specifically for our Python):
    for abi in abis:
        for arch in platforms:
            supported.append(('%s%s' % (impl, versions[0]), abi, arch))

    # abi3 modules compatible with older version of Python
    for version in versions[1:]:
        # abi3 was introduced in Python 3.2
        if version in ('31', '30'):
            break
        for abi in abi3s:   # empty set if not Python 3
            for arch in platforms:
                supported.append(("%s%s" % (impl, version), abi, arch))

    # No abi / arch, but requires our implementation:
    for i, version in enumerate(versions):
        supported.append(('%s%s' % (impl, version), 'none', 'any'))
        if i == 0:
            # Tagged specifically as being cross-version compatible
            # (with just the major version specified)
            supported.append(('%s%s' % (impl, versions[0][0]), 'none', 'any'))

    # Major Python version + platform; e.g. binaries not using the Python API
    supported.append(('py%s' % (versions[0][0]), 'none', arch))

    # No abi / arch, generic Python
    for i, version in enumerate(versions):
        supported.append(('py%s' % (version,), 'none', 'any'))
        if i == 0:
            supported.append(('py%s' % (version[0]), 'none', 'any'))

    return supported
1096546
def _get_cpu_info_from_cpuid():
	'''
	
	'''
	from multiprocessing import Process, Queue

	# Return {} if can't cpuid
	if not DataSource.can_cpuid:
		return {}

	# Get the CPU arch and bits
	arch, bits = _parse_arch(DataSource.arch_string_raw)

	# Return {} if this is not an X86 CPU
	if not arch in ['X86_32', 'X86_64']:
		return {}

	try:
		# Start running the function in a subprocess
		queue = Queue()
		p = Process(target=_actual_get_cpu_info_from_cpuid, args=(queue,))
		p.start()

		# Wait for the process to end, while it is still alive
		while p.is_alive():
			p.join(0)

		# Return {} if it failed
		if p.exitcode != 0:
			return {}

		# Return the result, only if there is something to read
		if not queue.empty():
			output = queue.get()
			return _b64_to_obj(output)
	except:
		pass

	# Return {} if everything failed
	return {}
733784
def get_server_capabilities(self):
        
        capabilities = {}
        system = self._get_host_details()
        capabilities['server_model'] = system['Model']
        rom_firmware_version = (
            system['Oem']['Hp']['Bios']['Current']['VersionString'])
        capabilities['rom_firmware_version'] = rom_firmware_version
        capabilities.update(self._get_ilo_firmware_version())
        capabilities.update(self._get_number_of_gpu_devices_connected())
        drive_details = self._get_drive_type_and_speed()
        if drive_details is not None:
            capabilities.update(drive_details)
        raid_details = self._get_logical_raid_levels()
        if raid_details is not None:
            capabilities.update(raid_details)
        if self._is_raid_supported():
            capabilities['hardware_supports_raid'] = 'true'
        boot_modes = common.get_supported_boot_modes(
            self.get_supported_boot_mode())
        capabilities.update({
            'boot_mode_bios': boot_modes.boot_mode_bios,
            'boot_mode_uefi': boot_modes.boot_mode_uefi})
        if self._get_tpm_capability():
            capabilities['trusted_boot'] = 'true'
        if self._get_cpu_virtualization():
            capabilities['cpu_vt'] = 'true'
        if self._get_nvdimm_n_status():
            capabilities['nvdimm_n'] = 'true'
        try:
            self._check_iscsi_rest_patch_allowed()
            capabilities['iscsi_boot'] = 'true'
        except exception.IloError:
            # If an error is raised dont populate the capability
            # iscsi_boot
            pass
        try:
            self.get_secure_boot_mode()
            capabilities['secure_boot'] = 'true'
        except exception.IloCommandNotSupportedError:
            # If an error is raised dont populate the capability
            # secure_boot
            pass
        if self._is_sriov_enabled():
            capabilities['sriov_enabled'] = 'true'
        return capabilities
36867
def check(cls, model, require_extra=False):
        
        class_capable = isinstance(model, cls)

        f_name = model.extra_capability_checks.get(cls, None) \
            if model.extra_capability_checks is not None \
            else False

        if f_name:
            f = getattr(model, f_name)
            instance_capable = f()
        elif not require_extra:
            instance_capable = True
        else:
            instance_capable = False
        return class_capable and instance_capable
389895
def _compare_version(self, requirements, support):
        

        for guid in requirements:
            # If we support any of the GUIDs in the guid_set, test if any of
            # the provided versions for the GUID are supported.
            if (guid in support and
                any((detected_version in requirements[guid]) for
                    detected_version in support[guid])):
                return True
854108
def get_cpu_info(self):
        
        info = snap7.snap7types.S7CpuInfo()
        result = self.library.Cli_GetCpuInfo(self.pointer, byref(info))
        check_error(result, context="client")
        return info
50886
def supports_color():
    
    unsupported_platform = (sys.platform in ('win32', 'Pocket PC'))
    # isatty is not always implemented, #6223.
    is_a_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
    if unsupported_platform or not is_a_tty:
        return False
    return True
810518
def get_processors(self):
        ""
        procs_x,procs_y = listify(self.train.x._processor),listify(self.train.y._processor)
        xp = ifnone(self.train.x.processor, [p(ds=self.train.x) for p in procs_x])
        yp = ifnone(self.train.y.processor, [p(ds=self.train.y) for p in procs_y])
        return xp,yp
1256201
def supported_sensor(sensor):
    """"""
    if sensor['type'] in DECONZ_BINARY_SENSOR + DECONZ_SENSOR + OTHER_SENSOR:
        return True
    _LOGGER.info('Unsupported sensor type %s (%s)',
                 sensor['type'], sensor['name'])
    return False
925511
def _is_modification_or_activity(feature):
    """"""
    if not (isinstance(feature, _bp('ModificationFeature')) or \
            isinstance(feature, _bpimpl('ModificationFeature'))):
        return None
    mf_type = feature.getModificationType()
    if mf_type is None:
        return None
    mf_type_terms = mf_type.getTerm().toArray()
    for term in mf_type_terms:
        if term in ('residue modification, active',
                    'residue modification, inactive',
                    'active', 'inactive'):
            return 'activity'
    return 'modification'
1244097
def check_for_cores(self):
        """"""
        if not len(self.cores):
            # Allow the user to override the exception to enable uses like chip bringup.
            if self.session.options.get('allow_no_cores', False):
                logging.error("No cores were discovered!")
            else:
                raise exceptions.DebugError("No cores were discovered!")