Return True if the theme *name* should be used.
15973
def is_theme(self, name):
        """"""
        return getattr(self.args, 'theme_' + name) or self.theme['name'] == name
907505
function defaultTheme(theme) {
  if (theme == null) return Form.defaultProps.theme
  if (typeof theme !== 'object') {
    throw new Error('Invalid Frig theme. Expected an object')
  }
  Form.defaultProps.theme = theme
  UnboundInput.defaultProps.theme = theme
  return true
}
587154
def use_theme(theme, directory=None):
    """"""
    repo = require_repo(directory)
    if theme not in list_themes(directory):
        raise ThemeNotFoundError(theme)

    old_theme = set_value(repo, 'theme', theme)
    return old_theme != theme
222279
def get_by_name(self, name, default=None):
        """"""
        for slide_layout in self:
            if slide_layout.name == name:
                return slide_layout
        return default
698357
def _apply_theme(self):
        
        self.theme.apply_axs(self.axs)
        self.theme.apply_figure(self.figure)
1056129
private function should_page_include_tabs() {
            if ( ! $this->has_settings_menu() ) {
                // Don't add tabs if no settings at all.
                return false;
            }

            if ( ! $this->is_theme() ) {
                // Only add tabs to themes for now.
                return false;
            }

            if ( ! $this->has_paid_plan() && ! $this->has_addons() ) {
                // Only add tabs to monetizing themes.
                return false;
            }

            if ( ! $this->is_theme_settings_page() ) {
                // Only add tabs if browsing one of the theme's setting pages.
                return false;
            }

            if ( $this->is_admin_page( 'pricing' ) && fs_request_get_bool( 'checkout' ) ) {
                // Don't add tabs on checkout page, we want to reduce distractions
                // as much as possible.
                return false;
            }

            return true;
        }
892045
public function themePathExists(string $resource): bool
    {
        if (file_exists($this->sourceDirectory.'/'.$resource)) {
            return true;
        }

        if (null === $this->theme) {
            return false;
        }

        $themeResource = $this->findThemeResource($this->theme, $resource);
        if (null !== $themeResource) {
            return true;
        }

        if (isset($this->theme['parent'])) {
            $themeResource = $this->findThemeResource($this->theme['parent'], $resource);
            if (null !== $themeResource) {
                return true;
            }
        }

        return false;
    }
1027667
function(name, theme) {
	        name != null && theme != null && (App.settings.themes[name] = theme);
	        delete App.vars.cache.themeKeys;
	        return this;
	    }
697257
def use_colorscheme(self, name='default'):
        
        try:
            self.current_style = get_editor_style_by_name(name)
        except pygments.util.ClassNotFound:
            pass
272275
private static function find_theme_config($themename, $settings, $parentscheck = true) {
        // We have to use the variable name $THEME (upper case) because that
        // is what is used in theme config.php files.

        if (!$dir = theme_config::find_theme_location($themename)) {
            return null;
        }

        $THEME = new stdClass();
        $THEME->name     = $themename;
        $THEME->dir      = $dir;
        $THEME->settings = $settings;

        global $CFG; // just in case somebody tries to use $CFG in theme config
        include("$THEME->dir/config.php");

        // verify the theme configuration is OK
        if (!is_array($THEME->parents)) {
            // parents option is mandatory now
            return null;
        } else {
            // We use $parentscheck to only check the direct parents (avoid infinite loop).
            if ($parentscheck) {
                // Find all parent theme configs.
                foreach ($THEME->parents as $parent) {
                    $parentconfig = theme_config::find_theme_config($parent, $settings, false);
                    if (empty($parentconfig)) {
                        return null;
                    }
                }
            }
        }

        return $THEME;
    }
847443
private function isPathValid(string $theme): bool
    {
        if (!is_dir(rtrim($this->themePath, '/') . '/' . $theme)) {
            return false;
        }

        return true;
    }
320837
public boolean accept(File file) {
    	String name = file.getName();
    	if (file.isDirectory()) {
    		return true;
    	}
    	return (name.startsWith("theme") && name.endsWith(".properties"));	        
    }
1242647
def set_theme(self, theme_name, toplevel=None, themebg=None):
        """"""
        if self._toplevel is not None and toplevel is None:
            toplevel = self._toplevel
        if self._themebg is not None and themebg is None:
            themebg = self._themebg
        ThemedWidget.set_theme(self, theme_name)
        color = self._get_bg_color()
        if themebg is True:
            self.config(background=color)
        if toplevel is True:
            self._setup_toplevel_hook(color)
1252553
protected function setThemeNameSelectorOptions()
    {
        $elementUri = tao_helpers_Uri::encode(DeliveryThemeDetailsProvider::DELIVERY_THEME_ID_URI);
        if (!$this->form->hasElement($elementUri)) {
            return false;
        }

        /** @var ThemeService $themeService */
        $themeService = ServiceManager::getServiceManager()->get(ThemeService::SERVICE_ID);
        $allThemes    = $themeService->getAllThemes();
        $options      = [];
        foreach ($allThemes as $currentThemeId => $currentTheme) {
            $options[$currentThemeId] = $currentThemeId;
            if (method_exists($currentTheme, 'getLabel')) {
                $options[$currentThemeId] = $currentTheme->getLabel();
            }
        }

        $this->form->getElement($elementUri)->setOptions($options);

        return true;
    }
977093
private boolean isDarkThemeSet() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.theme_preference_key);
        String defaultValue = getString(R.string.theme_preference_default_value);
        return Integer.valueOf(sharedPreferences.getString(key, defaultValue)) != 0;
    }
100930
function(themeName, extOptions) {
        var options = presetOptions[themeName];

        if (!options) {
            options = presetOptions[themeNameConst.DEFAULT];
        }
        options = $.extend(true, {}, options, extOptions);
        setDocumentStyle(options);
    }
220902
public function isInsideThemes($basename, $pathname, $depth)
    {
        $base = basename($this->upLevels($pathname, $depth - 1));
        return $base === THEMES_DIR;
    }