Returns popular themes found on the marketplace.
163680
public function requestPopularProducts($type = null)
    {
        if ($type != 'plugin' && $type != 'theme') {
            $type = 'plugin';
        }

        $cacheKey = 'system-updates-popular-'.$type;

        if (Cache::has($cacheKey)) {
            return @unserialize(@base64_decode(Cache::get($cacheKey))) ?: [];
        }

        $data = $this->requestServerData($type.'/popular');
        Cache::put($cacheKey, base64_encode(serialize($data)), 60);

        foreach ($data as $product) {
            $code = array_get($product, 'code', -1);
            $this->cacheProductDetail($type, $code, $product);
        }

        $this->saveProductDetailCache();

        return $data;
    }
838574
public function getAvailableThemes()
    {

        $returnValue = array();
        foreach ($this->getMap() as $target => $value) {
            //ugly
            if($target == ThemeRegistry::WEBSOURCE) {
                continue;
            }
            //retrieve all other value
            $returnValue[$target] = $value;

            // adapt path for all theme
            $returnValue[$target]['available'] = array();
            foreach ($value['available'] as $theme) {
                $returnValue[$target]['available'][] = $this->updatePath($theme);
            }

            $returnValue[$target]['base'] = $this->getResolvedBase($target);
        }
        return $returnValue;
    }
513944
def theme_lookup(self):
        

        # check cache
        cache_key = 'theme:%s' % self.domain_unsplit
        theme = cache.get(cache_key)
        if theme:
            THEME.value = theme
            return None

        # check database
        if hasattr(self.site, 'themes'):
            try:
                themes = [theme.name for theme in self.site.themes.all()]
                THEME.value = themes[0]
                cache.set(cache_key, THEME.value, 5*60)
            except:
                return False
        return None
1232174
def get_themes():
    
    styles_dir = os.path.join(package_dir, 'styles')
    themes = [os.path.basename(theme).replace('.less', '')
              for theme in glob('{0}/*.less'.format(styles_dir))]
    return themes
317156
public function getActiveThemesList()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $activeThemeList = [];
        if (!$this->isAdmin()) {
            $activeThemeList[] = $config->getConfigParam('sTheme');

            if ($customThemeId = $config->getConfigParam('sCustomTheme')) {
                $activeThemeList[] = $customThemeId;
            }
        }

        return $activeThemeList;
    }
69723
public static function getAvailableThemes($filterInstalled = true)
    {
        $db = Loader::db();
        $dh = Loader::helper('file');

        $themes = $dh->getDirectoryContents(DIR_FILES_THEMES);
        if ($filterInstalled) {
            // strip out themes we've already installed
            $handles = $db->GetCol('select pThemeHandle from PageThemes');
            $themesTemp = [];
            foreach ($themes as $t) {
                if (!in_array($t, $handles)) {
                    $themesTemp[] = $t;
                }
            }
            $themes = $themesTemp;
        }

        if (count($themes) > 0) {
            $themesTemp = [];
            // get theme objects from the file system
            foreach ($themes as $t) {
                $th = static::getByFileHandle($t);
                if (!empty($th)) {
                    $themesTemp[] = $th;
                }
            }
            $themes = $themesTemp;
        }

        return $themes;
    }
156969
def popular_content(**kwargs):
    
    limit = kwargs.get("limit", DEFAULT_LIMIT)
    popular_ids = get_popular_ids(limit=limit)
    if not popular_ids:
        # Return most recent content
        return Content.search_objects.search().extra(size=limit)
    return Content.search_objects.search().filter(es_filter.Ids(values=popular_ids))
746559
protected function getListThemeStore()
    {
        $themes = $this->module->getByType('theme', true);
        unset($themes[$this->theme_backend]);

        return $themes;
    }
148820
protected function getAvailableTheme(string $type): Collection
    {
        $themes = $this->foundation->make('orchestra.theme.finder')->detect();

        return $themes->filter(function ($manifest) use ($type) {
            if (! empty($manifest->type) && ! in_array($type, $manifest->type)) {
                return null;
            }

            return $manifest;
        });
    }
441741
def get_paths(self, theme, icon_size):
        """"""

        _size_str = "x".join(map(str, icon_size))

        theme_path = get_program_path() + "share" + os.sep + "icons" + os.sep
        icon_path = theme_path + theme + os.sep + _size_str + os.sep
        action_path = icon_path + "actions" + os.sep
        toggle_path = icon_path + "toggles" + os.sep

        return theme_path, icon_path, action_path, toggle_path
441760
public function getAvailableThemePaths()
    {
        $paths      = [];
        $themePaths = $this->getThemePaths();

        foreach ($themePaths as $path) {
            $this->files->isDirectory(base_path($path)) && $paths[] = base_path($path);
        }

        return $paths;
    }
465692
public function getCollectionThemeObject()
    {
        if (!isset($this->themeObject)) {
            $app = Facade::getFacadeApplication();
            $tmpTheme = $app->make(ThemeRouteCollection::class)
                ->getThemeByRoute($this->getCollectionPath());
            if (isset($tmpTheme[0])) {
                switch ($tmpTheme[0]) {
                    case VIEW_CORE_THEME:
                        $this->themeObject = new \Concrete\Theme\Concrete\PageTheme();
                        break;
                    case 'dashboard':
                        $this->themeObject = new \Concrete\Theme\Dashboard\PageTheme();
                        break;
                    default:
                        $this->themeObject = PageTheme::getByHandle($tmpTheme[0]);
                        break;
                }
            } elseif ($this->vObj->pThemeID < 1) {
                $this->themeObject = PageTheme::getSiteTheme();
            } else {
                $this->themeObject = PageTheme::getByID($this->vObj->pThemeID);
            }
        }
        if (!$this->themeObject) {
            $this->themeObject = PageTheme::getSiteTheme();
        }

        return $this->themeObject;
    }
1228573
def _get_theme_label(catalog, theme):
    """"""
    try:
        label = catalog.get_theme(identifier=theme)['label']
    except BaseException:
        try:
            label = catalog.get_theme(label=theme)['label']
        except BaseException:
            raise ce.ThemeNonExistentError(theme)

    label = re.sub(r'[^\wá-úÁ-ÚñÑ .-]+', '',
                   label, flags=re.UNICODE)
    return label
8636
protected function getAppliedStyles()
    {
        $applyStyles = $this->owner->config()->apply_styles;
        
        if (is_array($applyStyles)) {
            return $applyStyles;
        } elseif ($applyStyles == 'none') {
            return [];
        }
    }
1029499
def get_popular_aliases(self, *args, **kwargs):
        
        aliases_count_total = defaultdict(int)
        aliases_counts = self._timesheets_callback('get_popular_aliases')(*args, **kwargs)

        for aliases_count in aliases_counts:
            for alias, count in aliases_count:
                aliases_count_total[alias] += count

        sorted_aliases_count_total = sorted(aliases_count_total.items(), key=lambda item: item[1], reverse=True)

        return sorted_aliases_count_total
431110
public function getThemes()
    {
        $directory = new SplDirectoryInfo($this->getResourcesDir() . 'themes' . DIRECTORY_SEPARATOR);

        $themes = [];
        foreach ($directory->getTree() as $themeName => $themeTree) {
            if (($theme = $this->getTheme($themeName)) instanceof Module\Theme) {
                $themes[ $themeName ] = $theme;
            }
        }

        return $themes;
    }
865575
def _get_patterns(installed_only=None, root=None):
    '''
    
    '''
    patterns = {}
    for element in __zypper__(root=root).nolock.xml.call('se', '-t', 'pattern').getElementsByTagName('solvable'):
        installed = element.getAttribute('status') == 'installed'
        if (installed_only and installed) or not installed_only:
            patterns[element.getAttribute('name')] = {
                'installed': installed,
                'summary': element.getAttribute('summary'),
            }

    return patterns