Generate a list of installed offerings.

        @return: a generator of dictionaries mapping 'name' to the name of an
        offering installed on the store.
328165
def data_offerings(self, ctx, data):
        
        for io in self.original.store.query(offering.InstalledOffering):
            pp = ixmantissa.IPublicPage(io.application, None)
            if pp is not None and getattr(pp, 'index', True):
                warn("Use the sharing system to provide public pages,"
                     " not IPublicPage",
                     category=DeprecationWarning,
                     stacklevel=2)
                yield {'name': io.offeringName}
            else:
                s = io.application.open()
                try:
                    pp = getEveryoneRole(s).getShare(getDefaultShareID(s))
                    yield {'name': io.offeringName}
                except NoSuchShare:
                    continue
52576
def apps():
    '''
    
    '''
    response = salt.utils.http.query(
        "{0}/v2/apps".format(_base_url()),
        decode_type='json',
        decode=True,
    )
    return {'apps': [app['id'] for app in response['dict']['apps']]}
1039646
def get_distribution_list(self, dl_description):
        
        selector = dl_description.to_selector()

        resp = self.request_single('GetDistributionList', {'dl': selector})
        dl = zobjects.DistributionList.from_dict(resp)
        return dl
355578
def list_licenses(service_instance=None):
    '''
    
    '''
    log.trace('Retrieving all licenses')
    licenses = salt.utils.vmware.get_licenses(service_instance)
    ret_dict = [{'key': l.licenseKey,
                 'name': l.name,
                 'description': l.labels[0].value if l.labels else None,
                 # VMware handles unlimited capacity as 0
                 'capacity': l.total if l.total > 0 else sys.maxsize,
                 'used': l.used if l.used else 0}
                 for l in licenses]
    return ret_dict
751264
def installed_add_ons(self):
        
        if self._installed_add_ons is None:
            self._installed_add_ons = InstalledAddOnList(self)
        return self._installed_add_ons
408895
def get_campaign_name_list(self):
        
        campaigns = self.find('campaigns', {})
        campaign_names = []
        for campaign in campaigns:
            if 'name' in campaign:
                campaign_names.append(campaign['name'])
        return campaign_names
1151284
def create_app_list_dict(self):
        
        d = {}
        for app in self.app_list:
            models = {}
            for model in app.get('models', []):
                models[model.get('object_name').lower()] = model
            d[app.get('app_label').lower()] = {
                'app_url': app.get('app_url', ''),
                'app_label': app.get('app_label'),
                'models': models
            }
        return d
559259
def __gather_avail(self):
        '''
        
        '''
        avail = {}
        for saltenv in self._get_envs():
            avail[saltenv] = self.client.list_states(saltenv)
        return avail
828970
public void initializeOfferings() {
        FindIterable<Document> offerings = this.offeringsCollection.find();

        for (Document d : offerings) {
            offeringNames.add((String) d.get("offering_name"));
        }
    }
115210
def list_installed():
    '''
    
    '''
    result = __salt__['pkg.version'](_package_name(), versions_as_list=True)
    if result is None:
        return []

    if six.PY2:
        return sorted(result, cmp=_cmp_version)
    else:
        return sorted(result, key=functools.cmp_to_key(_cmp_version))
1239791
def _getAppStoreResource(self, ctx, name):
        
        offer = self.frontPageItem.store.findFirst(
            offering.InstalledOffering,
            offering.InstalledOffering.offeringName == unicode(name, 'ascii'))
        if offer is not None:
            pp = ixmantissa.IPublicPage(offer.application, None)
            if pp is not None:
                warn("Use the sharing system to provide public pages,"
                     " not IPublicPage",
                     category=DeprecationWarning,
                     stacklevel=2)
                return pp.getResource()
            return SharingIndex(offer.application.open(),
                                self.webViewer)
        return None
1093956
def get_markup_choices():
    
    available_reader_list = []
    module_dir = os.path.realpath(os.path.dirname(__file__))
    module_names = filter(
        lambda x: x.endswith('_reader.py'), os.listdir(module_dir))

    for module_name in module_names:
        markup = module_name.split('_')[0]
        reader = get_reader(markup=markup)

        if reader.enabled is True:
            available_reader_list.append((markup, reader.name))

    return available_reader_list
1231555
def get_records_for_package(self, package_name):
        

        names = self.package_module_map.get(package_name, [])
        result = {}
        for name in names:
            result.update(self.get_record(name))
        return result
918
def load_installed_plugins():
        """"""
        providers = {}
        checkers = {}
        for entry_point in pkg_resources.iter_entry_points(group='archan'):
            obj = entry_point.load()
            if issubclass(obj, Provider):
                providers[entry_point.name] = obj
            elif issubclass(obj, Checker):
                checkers[entry_point.name] = obj
        return collections.namedtuple(
            'Plugins', 'providers checkers')(
                providers=providers,
                checkers=checkers)
191112
def per_installer_data(self):
        
        ret = {}
        for cache_date in self.cache_dates:
            data = self._cache_get(cache_date)
            ret[cache_date] = {}
            for inst_name, inst_data in data['by_installer'].items():
                for inst_ver, count in inst_data.items():
                    k = self._compound_column_value(
                        inst_name,
                        self._shorten_version(inst_ver)
                    )
                    ret[cache_date][k] = count
            if len(ret[cache_date]) == 0:
                ret[cache_date]['unknown'] = 0
        return ret
14458
def getInstalled():
    
    installed = _find_installed()
    return [os.path.basename(p.pathname)[3:] for p in installed]
350648
def list_installed():
    '''
    
    '''
    pkg_re = re.compile(r'^{0}-[\d.-]+-{1}$'.format(
        _package_prefix(), _kernel_type()))
    pkgs = __salt__['pkg.list_pkgs'](versions_as_list=True)
    if pkgs is None:
        pkgs = []

    result = list(filter(pkg_re.match, pkgs))
    if result is None:
        return []

    prefix_len = len(_package_prefix()) + 1

    if six.PY2:
        return sorted([pkg[prefix_len:] for pkg in result], cmp=_cmp_version)
    else:
        return sorted([pkg[prefix_len:] for pkg in result], key=functools.cmp_to_key(_cmp_version))