todo: Docstring for installed

        :param name: arg description
        :type name: type description
        :return:
        :rtype:
342159
def installed(self, name):
        
        logger.debug("name: %s", name)

        self._installed[name] = True
        return name
477719
def generate_feature(self, name, policy='require'):
        

        return ET.Element('feature', policy=policy, name=name)
1127559
def install(cls, type_, name, src, *args, **kwargs):
        """"""
        data = kwargs.pop('data', None)
        if data is None:
            data = {
                'addon': {
                    'type': type_,
                    'name': name,
                    'src': src,
                }
            }
        cls.create(data=data, *args, **kwargs)
687505
def select_scheme(self, name):
        """"""
        # it's the caller's problem if they supply a bad name!
        scheme = INSTALL_SCHEMES[name]
        for key in SCHEME_KEYS:
            attrname = 'install_' + key
            if getattr(self, attrname) is None:
                setattr(self, attrname, scheme[key])
166730
def load_module(name):
    

    spec = importlib.util.find_spec(name)
    mod = importlib.util.module_from_spec(spec)
    mod.__spec__ = spec
    mod.__loader__ = spec.loader
    spec.loader.exec_module(mod)
    return mod
1300047
def getNamedItem(self, name: str) -> Optional[Attr]:
        
        return self._dict.get(name, None)
213353
def load_module(self, name):
        
        # allow reload noop
        if name in sys.modules:
            return sys.modules[name]
        raise DisabledIncludeError('Include type %r disabled, cannot import module %r' % (self._module_prefix, name))
730592
def get_package_id(self, name):
        
        json_scheme = self.gen_def_json_scheme('GetPreConfiguredPackages', dict(HypervisorType=4))
        json_obj = self.call_method_post(method='GetPreConfiguredPackages ', json_scheme=json_scheme)
        for package in json_obj['Value']:
            packageId  = package['PackageID']
            for description in package['Descriptions']:
                languageID = description['LanguageID']
                packageName = description['Text']
                if languageID == 2 and packageName.lower() == name.lower():
                    return packageId
1349679
def import_object(modname, name):
    
    try:
        __import__(modname)
        mod = sys.modules[modname]
        obj = mod
        for part in name.split('.'):
            obj = getattr(obj, part)
        return obj
    except:
        return None
1364488
def define(
    name: str,
    default: Any = None,
    type: type = None,
    help: str = None,
    metavar: str = None,
    multiple: bool = False,
    group: str = None,
    callback: Callable[[Any], None] = None,
) -> None:
    
    return options.define(
        name,
        default=default,
        type=type,
        help=help,
        metavar=metavar,
        multiple=multiple,
        group=group,
        callback=callback,
    )
1104791
def builtin(self, name):
        """"""
        builtin_name = ast.Name("@py_builtins", ast.Load())
        return ast.Attribute(builtin_name, name, ast.Load())
363228
def did_u_mean(name):
    
    logger.debug("%s", name)

    dlist = Repo.installed_list()
    res = []
    for d in dlist:
        if name in d.name or d.name in name:
            res.append(nice_pkg_name(d.name))
    # end for d in dlist

    if res:
        return "Did you mean '" + " or ".join(res) + "'?"

    return ""
271596
def my_import(name):
    
    module, attr = name.rsplit('.', 1)
    mod = __import__(module, fromlist=[attr])
    klass = getattr(mod, attr)
    return klass()
1314166
def package_install(name, **kwargs):
    '''
    
    '''
    cmd = DETAILS['url']+'package/install/'+name
    if kwargs.get('version', False):
        cmd += '/'+kwargs['version']
    else:
        cmd += '/1.0'
    r = salt.utils.http.query(cmd, decode_type='json', decode=True)
    return r['dict']
957743
def installed(name, nodataset=False, brand_opts=None):
    '''
    

    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    zones = __salt__['zoneadm.list'](installed=True, configured=True)
    if name in zones:
        if zones[name]['state'] == 'configured':
            if __opts__['test']:
                res_install = {'status': True}
            else:
                res_install = __salt__['zoneadm.install'](name, nodataset, brand_opts)
            ret['result'] = res_install['status']
            if ret['result']:
                ret['changes'][name] = 'installed'
                ret['comment'] = 'The zone {0} was installed.'.format(name)
            else:
                ret['comment'] = []
                ret['comment'].append('Failed to install zone {0}!'.format(name))
                if 'message' in res_install:
                    ret['comment'].append(res_install['message'])
                ret['comment'] = "\n".join(ret['comment'])
        else:
            ret['result'] = True
            ret['comment'] = 'zone {0} already installed.'.format(name)
    else:
        ret['result'] = False
        ret['comment'] = 'zone {0} is not configured!'.format(name)

    return ret
752346
def service(self, name: str = None):
        
        if self._services_initialized:
            from warnings import warn
            warn('Services have already been initialized. Please register '
                 f'{name} sooner.')
            return lambda x: x

        def wrapper(service):
            self.register_service(name, service)
            return service
        return wrapper
268296
def find_description(self, name):
        ""
        for desc in self.virtual_system_descriptions:
            values = desc.get_values_by_type(DescType.name,
                                             DescValueType.original)
            if name in values:
                break
        else:
            raise Exception("Failed to find description for %s" % name)
        return desc