Lookup the system icon name from udisie-internal id.
977224
def get_icon_name(self, icon_id: str) -> str:
        """"""
        icon_theme = Gtk.IconTheme.get_default()
        for name in self._icon_names[icon_id]:
            if icon_theme.has_icon(name):
                return name
        return 'not-available'
973876
def _init_sys_auto_lookup(self):
        
        # TODO: Instead, check for executables for systemd and upstart
        # systemctl for systemd and initctl for upstart.
        # An alternative might be to check the second answer here:
        # http://unix.stackexchange.com/questions/196166/how-to-find-out-if-a-system-uses-sysv-upstart-or-systemd-initsystem
        # TODO: Move to each system's implementation
        init_systems = []
        if self._is_init_system_installed('/usr/lib/systemd'):
            init_systems.append('systemd')
        if self._is_init_system_installed('/usr/share/upstart'):
            init_systems.append('upstart')
        if self._is_init_system_installed('/etc/init.d'):
            init_systems.append('sysv')
        return init_systems
1333461
private String getOsName() {
        // windows
        if (OS_NAME.contains("win")) {
            boolean is64bit = (System.getenv("ProgramFiles(x86)") != null);
            return "windows_" + (is64bit ? "x86_64" : "x86");
        } else if (OS_NAME.contains("mac")) {
            // mac osx
            return "mac_" + OS_ARCH;
        } else if (OS_NAME.contains("nix") || OS_NAME.contains("nux") || OS_NAME.indexOf("aix") > 0) {
            // unix
            return "amd64".equalsIgnoreCase(OS_ARCH) ? "linux_x86_64" : "linux_" + OS_ARCH;
        } else {
            throw new WebpIOException("Hi boy, Your OS is not support!!");
        }
    }
125858
def ui_label(self):
        """"""
        return ': '.join(filter(None, [
            self.ui_device_presentation,
            self.ui_id_label or self.ui_id_uuid or self.drive_label
        ]))
1013207
def get_device_id(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        return device_json["id"].get("devId")
73210
public String getDisplayName(String id, ULocale locale) {
        Map<String, Factory> m = getVisibleIDMap();
        Factory f = m.get(id);
        if (f != null) {
            return f.getDisplayName(id, locale);
        }

        Key key = createKey(id);
        while (key.fallback()) {
            f = m.get(key.currentID());
            if (f != null) {
                return f.getDisplayName(id, locale);
            }
        }

        return null;
    }
9633
def ifaces(cls, name):
        
        ifaces = Iface.list({'vlan_id': cls.usable_id(name)})
        ret = []
        for iface in ifaces:
            ret.append(Iface.info(iface['id']))
        return ret
1132952
private int findSid(SymbolToken symToken)
    {
        int sid = symToken.getSid();
        String text = symToken.getText();

        if (sid != UNKNOWN_SYMBOL_ID)   // sid is assigned
        {
            assert text == null ||
                   text.equals(mySymbolTable.findKnownSymbol(sid));
        }
        else                            // sid is not assigned
        {
            if (mySymbolTable.isSystemTable())
            {
                // Replace current symtab with a new local symbol table
                // using the default system symtab
                mySymbolTable = myIonSystem.newLocalSymbolTable();
            }

            // Intern the new symbol and get its assigned sid
            sid = mySymbolTable.intern(text).getSid();
        }

        return sid;
    }
745040
def show_std_icons():
    
    app = qapplication()
    dialog = ShowStdIcons(None)
    dialog.show()
    sys.exit(app.exec_())
401949
def _get_cpu_info_internal():
	'''
	
	'''

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

	friendly_maxsize = { 2**31-1: '32 bit', 2**63-1: '64 bit' }.get(sys.maxsize) or 'unknown bits'
	friendly_version = "{0}.{1}.{2}.{3}.{4}".format(*sys.version_info)
	PYTHON_VERSION = "{0} ({1})".format(friendly_version, friendly_maxsize)

	info = {
		'python_version' : PYTHON_VERSION,
		'cpuinfo_version' : CPUINFO_VERSION,
		'cpuinfo_version_string' : CPUINFO_VERSION_STRING,
		'arch' : arch,
		'bits' : bits,
		'count' : DataSource.cpu_count,
		'arch_string_raw' : DataSource.arch_string_raw,
	}

	# Try the Windows wmic
	_copy_new_fields(info, _get_cpu_info_from_wmic())

	# Try the Windows registry
	_copy_new_fields(info, _get_cpu_info_from_registry())

	# Try /proc/cpuinfo
	_copy_new_fields(info, _get_cpu_info_from_proc_cpuinfo())

	# Try cpufreq-info
	_copy_new_fields(info, _get_cpu_info_from_cpufreq_info())

	# Try LSCPU
	_copy_new_fields(info, _get_cpu_info_from_lscpu())

	# Try sysctl
	_copy_new_fields(info, _get_cpu_info_from_sysctl())

	# Try kstat
	_copy_new_fields(info, _get_cpu_info_from_kstat())

	# Try dmesg
	_copy_new_fields(info, _get_cpu_info_from_dmesg())

	# Try /var/run/dmesg.boot
	_copy_new_fields(info, _get_cpu_info_from_cat_var_run_dmesg_boot())

	# Try lsprop ibm,pa-features
	_copy_new_fields(info, _get_cpu_info_from_ibm_pa_features())

	# Try sysinfo
	_copy_new_fields(info, _get_cpu_info_from_sysinfo())

	# Try querying the CPU cpuid register
	_copy_new_fields(info, _get_cpu_info_from_cpuid())

	# Try platform.uname
	_copy_new_fields(info, _get_cpu_info_from_platform_uname())

	return info
205606
def internal(identifier, size):
    '''
    
    '''
    identicon = generate_pydenticon(identifier, size)
    response = send_file(io.BytesIO(identicon), mimetype='image/png')
    etag = hashlib.sha1(identicon).hexdigest()
    response.set_etag(etag)
    return response
953636
def app_id(iface=''):
    
    if iface:
        return uniqid(iface)

    if platform.system() == 'Darwin':
        _ava_start = ['en']
    elif platform.system() == 'Linux':
        _ava_start = ['eth', 'wla']
    else:
        return None

    nics = psutil.net_if_addrs()
    _ifces = list(nics.keys())
    _ifces.sort()

    for _ in _ifces:
        if _[:len(_ava_start[0])] in _ava_start:
            return uniqid(_)
987285
def interface_lookup(interfaces, hwaddr, address_type):
    """"""
    for interface in interfaces.values():
        if interface.get('hwaddr') == hwaddr:
            for address in interface.get('addrs'):
                if address.get('type') == address_type:
                    return address.get('addr')
98420
def device_uuid(self):
        """"""
        if self._device:
            return self._device
        return GEN_ID_FORMAT.format(self.src_ip)
286729
def _pid_to_id(self, pid):
        """"""
        return d1_common.url.joinPathElements(
            self._base_url,
            self._version_tag,
            "resolve",
            d1_common.url.encodePathElement(pid),
        )
94167
def _aix_get_machine_id():
    '''
    
    '''
    grains = {}
    cmd = salt.utils.path.which('lsattr')
    if cmd:
        data = __salt__['cmd.run']('{0} -El sys0'.format(cmd)) + os.linesep
        uuid_regexes = [re.compile(r'(?im)^\s*os_uuid\s+(\S+)\s+(.*)')]
        for regex in uuid_regexes:
            res = regex.search(data)
            if res and len(res.groups()) >= 1:
                grains['machine_id'] = res.group(1).strip()
                break
    else:
        log.error('The \'lsattr\' binary was not found in $PATH.')
    return grains
471055
def cli(env, identifier):
    """"""

    manager = SoftLayer.HardwareManager(env.client)
    hardware_id = helpers.resolve_id(manager.resolve_ids,
                                     identifier,
                                     'hardware')
    instance = manager.get_hardware(hardware_id)

    table = formatting.Table(['username', 'password'])
    for item in instance['softwareComponents']:
        if 'passwords' not in item:
            raise exceptions.SoftLayerError("No passwords found in softwareComponents")
        for credentials in item['passwords']:
            table.add_row([credentials.get('username', 'None'), credentials.get('password', 'None')])
    env.fout(table)