Gets all the licenses
        Returns:
        List of licenses
17382
def licenses(self):
        
        if not self.__licenses:
            self.__licenses = Licenses(self.__connection)
        return self.__licenses
1179440
def license(self, key, value):
    """"""
    def _get_license(value):
        a_values = force_list(value.get('a'))

        oa_licenses = [el for el in a_values if el == 'OA' or el == 'Open Access']
        other_licenses = [el for el in a_values if el != 'OA' and el != 'Open Access']

        if not other_licenses:
            return force_single_element(oa_licenses)
        return force_single_element(other_licenses)

    def _get_material(value):
        material = value.get('3', '').lower()
        if material == 'article':
            return 'publication'
        return material

    return {
        'imposing': value.get('b'),
        'license': _get_license(value),
        'material': _get_material(value),
        'url': value.get('u'),
    }
52266
def all(self, instance):
        
        url = self._url.format(instance=instance)
        response = requests.get(url, **self._default_request_kwargs)
        data = self._get_response_data(response)
        return self._concrete_acl_list(data)
1244870
def get_license(self):
        
        if 'license' in self.my_osid_object._my_map:
            license_text = self.my_osid_object._my_map['license']
            return DisplayText(display_text_map=license_text)
        return DisplayText(text='',
                           language_type=DEFAULT_LANGUAGE_TYPE,
                           format_type=DEFAULT_FORMAT_TYPE,
                           script_type=DEFAULT_SCRIPT_TYPE)
334446
def get_all(self):
        
        components = []
        
        self._lock.acquire()
        try:
            for reference in self._references:
                components.append(reference.get_component())
        finally:
            self._lock.release()

        return components
1072155
def all(self):
        
        response = requests.get(self._url, **self._default_request_kwargs)
        data = self._get_response_data(response)
        return self._concrete_instance_list(data)
739877
private static function get_all_licenses_by_module_type() {
            $licenses = self::get_account_option( 'all_licenses' );

            $licenses_by_module_type = array(
                WP_FS__MODULE_TYPE_PLUGIN => array(),
                WP_FS__MODULE_TYPE_THEME  => array()
            );

            if ( ! is_array( $licenses ) ) {
                return $licenses_by_module_type;
            }

            foreach ( $licenses as $module_id => $module_licenses ) {
                $fs = self::get_instance_by_id( $module_id );
                if ( false === $fs ) {
                    continue;
                }

                $licenses_by_module_type[ $fs->_module_type ] = array_merge( $licenses_by_module_type[ $fs->_module_type ], $module_licenses );
            }

            return $licenses_by_module_type;
        }
269547
def get_all_courses(self):
        
        course_ids = [f[0:len(f)-1] for f in self._filesystem.list(folders=True, files=False, recursive=False)]  # remove trailing "/"
        output = {}
        for courseid in course_ids:
            try:
                output[courseid] = self.get_course(courseid)
            except Exception:
                get_course_logger(courseid).warning("Cannot open course", exc_info=True)
        return output
73381
def license(self, license_id: str, token: dict = None, prot: str = "https") -> dict:
        
        # handling request parameters
        payload = {"lid": license_id}

        # search request
        license_url = "{}://v1.{}.isogeo.com/licenses/{}".format(
            prot, self.api_url, license_id
        )
        license_req = self.get(
            license_url,
            headers=self.header,
            params=payload,
            proxies=self.proxies,
            verify=self.ssl,
        )

        # checking response
        checker.check_api_response(license_req)

        # end of method
        return license_req.json()
1353590
def get_all():
    '''
    
    '''
    (enabled_services, disabled_services) = _get_service_list(include_enabled=True,
                                                              include_disabled=True)
    enabled_services.update(dict([(s, []) for s in disabled_services]))
    return odict.OrderedDict(enabled_services)
867829
def provider_list(self, lookup='all'):
        '''
        
        '''
        data = {}
        lookups = self.lookup_providers(lookup)
        if not lookups:
            return data

        for alias, driver in lookups:
            if alias not in data:
                data[alias] = {}
            if driver not in data[alias]:
                data[alias][driver] = {}
        return data
586434
def _list(self):
        
        all = self.driver.instance.metadata.get(search=self.namespace)
        list = []
        for id in all:
            try:
                if not self._get(id['id']) in list:
                    list.append(self._get(id['id']))
            except Exception:
                pass

        return list
645136
def all(self):
        
        return {
            self._decode(k): self._loads(v)
            for k, v in self._client.hgetall(self.key_prefix).items()
        }
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
101888
def license_present(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    if not __salt__['powerpath.has_powerpath']():
        ret['result'] = False
        ret['comment'] = 'PowerPath is not installed.'
        return ret

    licenses = [l['key'] for l in __salt__['powerpath.list_licenses']()]

    if name in licenses:
        ret['result'] = True
        ret['comment'] = 'License key {0} already present'.format(name)
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'License key {0} is set to be added'.format(name)
        return ret

    data = __salt__['powerpath.add_license'](name)
    if data['result']:
        ret['changes'] = {name: 'added'}
        ret['result'] = True
        ret['comment'] = data['output']
        return ret
    else:
        ret['result'] = False
        ret['comment'] = data['output']
        return ret
633333
@SuppressWarnings("unchecked")
    public Collection<ProductResourceImpl> getAllProducts(LicenseType licenseType) throws RepositoryBackendException {
        Collection<ProductResourceImpl> product = (Collection<ProductResourceImpl>) getAllResources(licenseType, ResourceType.INSTALL);
        Collection<ProductResourceImpl> addons = (Collection<ProductResourceImpl>) getAllResources(licenseType, ResourceType.ADDON);
        product.addAll(addons);
        return product;
    }
397157
def license_loader(lic_dir=LIC_DIR):
    """"""
    lics = []
    for ln in os.listdir(lic_dir):
        lp = os.path.join(lic_dir, ln)
        with open(lp) as lf:
            txt = lf.read()
            lic = License(txt)
            lics.append(lic)
    return lics