Return a list of tuples of available init systems on the
        current machine.

        Note that in some situations (Ubuntu 14.04 for instance) more than
        one init system can be found.
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
952514
def get_init(self):
        
        suffix = self._separator + "%s" % str(self._counter_init)

        return self._base_name + suffix
509925
def was_init():
    
    mask = lib.SDL_WasInit(0)
    return enumtools.get_items(InitFlags, mask, {InitFlags.everything})
265589
def machines(self, id=None, name=None, search=None):
        
        if self._machines is None:
            self._machines = {}
            self._list_machines()

        if id:
            return [self._machines[machine_id] for machine_id in self._machines.keys()
                    if str(id) == str(self._machines[machine_id].id)]
        elif name:
            return [self._machines[machine_id] for machine_id in self._machines.keys()
                    if name == self._machines[machine_id].name]
        elif search:
            return [self._machines[machine_id] for machine_id in self._machines.keys()
                    if str(search) == str(self._machines[machine_id].name)
                    or str(search) == str(self._machines[machine_id].id)]
        else:
            return [self._machines[machine_id] for machine_id in self._machines.keys()]
215293
def subsystems(self):
    """"""
    ret = set()
    for task_type in self.task_types():
      ret.update([dep.subsystem_cls for dep in task_type.subsystem_dependencies_iter()])
    return ret
1345685
def get_ip_addresses(self, machine, *, boot_only=False, discovered=False):
        
        boot_ips = [
            link.ip_address
            for link in machine.boot_interface.links
            if link.ip_address
        ]
        if boot_only:
            if boot_ips:
                return boot_ips
            elif discovered:
                return [
                    link.ip_address
                    for link in machine.boot_interface.discovered
                    if link.ip_address
                ]
            else:
                return []
        else:
            other_ips = [
                link.ip_address
                for interface in machine.interfaces
                for link in interface.links
                if (interface.id != machine.boot_interface.id and
                    link.ip_address)
            ]
            ips = boot_ips + other_ips
            if ips:
                return ips
            elif discovered:
                return [
                    link.ip_address
                    for link in machine.boot_interface.discovered
                    if link.ip_address
                ] + [
                    link.ip_address
                    for interface in machine.interfaces
                    for link in interface.discovered
                    if (interface.id != machine.boot_interface.id and
                        link.ip_address)
                ]
            else:
                return []
518711
def get_initializers(self) -> List[Tuple[str, mx.init.Initializer]]:
        
        patterns_vals = []
        # Load from args/auxs
        for k in self.args.keys():
            patterns_vals.append((k, mx.init.Load({k: self.args[k]})))
        for k in self.auxs.keys():
            patterns_vals.append((k, mx.init.Load({k: self.auxs[k]})))
        # Initialize
        for k in self.names:
            patterns_vals.append((k, mx.init.Xavier(rnd_type='uniform', factor_type='avg', magnitude=3)))

        return patterns_vals
1063781
def avail_platforms():
    '''
    
    '''
    ret = {}
    for platform in CMD_MAP:
        ret[platform] = True
        for cmd in CMD_MAP[platform]:
            if not salt.utils.path.which(cmd):
                ret[platform] = False
    return ret
526091
@SuppressWarnings("unchecked")
    public Enumeration<String> getInitParameterNames() {
        List<String> initParameterNames = Collections.list(servletConfig.getInitParameterNames());
        initParameterNames.addAll(additionalConfigurations.keySet());
        return Collections.enumeration(initParameterNames);
    }
914088
def init(self):
        '''
        
        '''
        super(Visa, self).init()
        backend = self._init.get('backend', '')  # Empty string means std. backend (NI VISA)
        rm = visa.ResourceManager(backend)
        try:
            logger.info('BASIL VISA TL with %s backend found the following devices: %s', backend, ", ".join(rm.list_resources()))
        except NotImplementedError:  # some backends do not always implement the list_resources function
            logger.info('BASIL VISA TL with %s backend', backend)
        self._resource = rm.open_resource(**{key: value for key, value in self._init.items() if key not in ("backend",)})
1006760
def _init():
    

    preferred = os.getenv("QT_PREFERRED_BINDING")
    verbose = os.getenv("QT_VERBOSE") is not None

    if preferred:

        # Debug mode, used in installer
        if preferred == "None":
            sys.modules[__name__].__wrapper_version__ = __version__
            return

        available = {
            "PySide2": _pyside2,
            "PySide": _pyside,
            "PyQt5": _pyqt5,
            "PyQt4": _pyqt4
        }

        if preferred not in available:
            raise ImportError("Preferred Qt binding \"%s\" "
                              "not available" % preferred)

        binding = available[preferred]
        sys.modules[__name__] = binding()
        return

    else:
        for binding in (_pyside2,
                        _pyqt5,
                        _pyside,
                        _pyqt4):

            if verbose:
                sys.stdout.write("Trying %s" % binding.__name__[1:])

            try:
                sys.modules[__name__] = binding()
                return

            except ImportError as e:

                if verbose:
                    sys.stdout.write(" - ImportError(\"%s\")\n" % e)

                continue

    # If not binding were found, throw this error
    raise ImportError("No Qt binding were found.")
1229005
private List<String> getAllInitializers()
    {
        final List<String> ret = new ArrayList<>();
        for (final CacheMethod cacheMethod : this.cacheMethods) {
            ret.add(cacheMethod.className);
        }
        if (this.parent != null) {
            ret.addAll(this.parent.getAllInitializers());
        }
        return ret;
    }
158244
def defaultSystem():
    
    rsystem = platform.system()

    # Try to lookup the string in the canon tables
    if rsystem in os_canon:
        rsystem = os_canon[rsystem][0]

    return rsystem
666213
def init_all_receivers():
    
    receivers = discover()

    init_receivers = []
    for receiver in receivers:
        init_receiver = DenonAVR(receiver["host"])
        init_receivers.append(init_receiver)
    return init_receivers
659820
def _set_init_system(self, client):
        """"""
        if not self.init_system:
            try:
                out = ipa_utils.execute_ssh_command(
                    client,
                    'ps -p 1 -o comm='
                )
            except Exception as e:
                raise IpaDistroException(
                    'An error occurred while retrieving'
                    ' the distro init system: %s' % e
                )
            if out:
                self.init_system = out.strip()
540597
def from_sys_requirements(cls, system_requirements, _type='all'):
        
        if _type not in ('all', 'clusterSpec', 'instanceType'):
            raise DXError("Expected '_type' to be either 'all', 'clusterSpec', or 'instanceType'")

        if _type == 'all':
            return cls(system_requirements)

        extracted = defaultdict(dict)
        for entrypoint, req in system_requirements.items():
            if _type in req:
                extracted[entrypoint][_type] = req[_type]
        return cls(dict(extracted))
600843
def get_backend_init_list(backend_vals):
    """"""
    cmd_list = []
    for (key, val) in backend_vals.items():
        cmd_list.append('-backend-config')
        cmd_list.append(key + '=' + val)
    return cmd_list