Returns a bool whether or not this node is a KVM hypervisor
965104
def _is_kvm_hyper():
    '''
    
    '''
    try:
        with salt.utils.files.fopen('/proc/modules') as fp_:
            if 'kvm_' not in salt.utils.stringutils.to_unicode(fp_.read()):
                return False
    except IOError:
        # No /proc/modules? Are we on Windows? Or Solaris?
        return False
    return 'libvirtd' in __salt__['cmd.run'](__grains__['ps'])
267609
def is_available(cls, disk, kernel):
        
        kmap = cls.list(disk['datacenter_id'], None, kernel, True)
        for flavor in kmap:
            if kernel in kmap[flavor]:
                return True
        return False
713016
def vagrant_box_running?(node)
      status = `cd #{node.project_root} && vagrant status`
      (status =~ /#{node.hostname}\s+running/) ? true : false
    end
500568
def is_none(node):
    '''
    '''
    if PY2:
        return isinstance(node, ast.Name) and node.id == 'None'
    return isinstance(node, ast.NameConstant) and node.value is None
766144
def check(self, radl):
        """"""

        if not radl.get_system_by_name(self.id):
            raise RADLParseException("Invalid system id in the deploy.", line=self.line)

        if self.vm_number < 0:
            raise RADLParseException("Invalid number of virtual machines to deploy.",
                                     line=self.line)
1032987
def IsCloud(self, request, bios_version, services):
    """"""
    if request.bios_version_regex and bios_version:
      if re.match(request.bios_version_regex, bios_version):
        return True
    if request.service_name_regex and services:
      if re.search(request.service_name_regex, services):
        return True
    return False
8384
def get_local_hypervisor(self):
        
        # Look up hypervisors available filtered by my hostname
        host = self.get_my_hostname()
        hyp = self.get_all_hypervisor_ids(filter_by_host=host)
        if hyp:
            return hyp[0]
232333
def parent_machine
      current = parent
      current = current.parent while current && !current.is_a?(VM)
      current
    end
554191
function isNode(val) {
  if (!isObject(val)) {
    return false;
  }
  if (isDefined(window) && isObject(window.Node)) {
    return val instanceof window.Node;
  }
  return typeof val.nodeType === 'number' && typeof val.nodeName === 'string';
}
1043391
def ubridge(self):
        

        if self._ubridge_hypervisor and not self._ubridge_hypervisor.is_running():
            self._ubridge_hypervisor = None
        return self._ubridge_hypervisor
211624
def is_node(objecttype):
    
    if not isclass(objecttype):
        return False

    if not issubclass(objecttype, ObjectType):
        return False

    for i in objecttype._meta.interfaces:
        if issubclass(i, Node):
            return True

    return False
317013
private boolean checkIfHostHasChanged(EventChannelStruct event_channel_struct) {
        boolean retVal = false;
        try {
            IORdump dump = new IORdump(event_channel_struct.adm_device_proxy);
            String server_host = dump.get_hostname();

            //	Keep server_host name without Fully Qualify Domain Name
            int idx = server_host.indexOf('.');
            if (idx > 0)
                server_host = server_host.substring(0, idx);

            if (!event_channel_struct.host.equals(server_host))
                retVal = true;
        } catch (DevFailed e) { /* */ }
        return retVal;
    }
166944
def bsp_contains(node: tcod.bsp.BSP, cx: int, cy: int) -> bool:
    
    return node.contains(cx, cy)
491348
def is_exported(self):
        
        self.open()
        exp = lvm_vg_is_exported(self.handle)
        self.close()
        return bool(exp)
1287779
def _find_vm(name, data, quiet=False):
    '''
    
    '''
    for hv_ in data:
        # Check if data is a dict, and not '"virt.full_info" is not available.'
        if not isinstance(data[hv_], dict):
            continue
        if name in data[hv_].get('vm_info', {}):
            ret = {hv_: {name: data[hv_]['vm_info'][name]}}
            if not quiet:
                __jid_event__.fire_event({'data': ret, 'outputter': 'nested'}, 'progress')
            return ret
    return {}
1062872
def on_gcloud_vm():
    
    r = None
    try:
        r = requests.get('http://metadata.google.internal')
    except requests.ConnectionError:
        return False

    try:
        if r.headers['Metadata-Flavor'] == 'Google' and \
           r.headers['Server'] == 'Metadata Server for VM':
            return True
    except KeyError:
        return False
100553
def add_to_virtualbox(self):
        
        # VirtualBox Image
        if 'vmname' not in self.node['properties']:
            self.node['properties']['vmname'] = \
                self.hypervisor['VBoxDevice']['image']
        # Number of adapters
        if 'adapters' not in self.node['properties']:
            self.node['properties']['adapters'] = \
                self.hypervisor['VBoxDevice']['nics']
        # Console Port
        if 'console' not in self.node['properties']:
            self.node['properties']['console'] = \
                self.base_ports['vbox_console'] + self.node['vbox_id'] - 1