Change the current(default) theme

    Parameters
    ----------
    new : theme
        New default theme

    Returns
    -------
    out : theme
        Previous theme
1995
def theme_set(new):
    
    if (not isinstance(new, theme) and
            not issubclass(new, theme)):
        raise PlotnineError("Expecting object to be a theme")

    out = get_option('current_theme')
    set_option('current_theme', new)
    return out
214488
def changes
      changes = {'new' => {}, 'obsolete' => {}, 'updated' => {}}

      if @environment.nil?
        new_environments.each do |env|
          changes['new'][env] = {}
        end

        old_environments.each do |env|
          changes['obsolete'][env] = {}
        end
      else
        env = @environment
        changes['new'][env] = {} if new_environments.include?(@environment)
        changes['obsolete'][env] = {} if old_environments.include?(@environment)
      end
      changes
    end
1099521
def theme_get():
    
    from .theme_gray import theme_gray
    _theme = get_option('current_theme')
    if isinstance(_theme, type):
        _theme = _theme()
    return _theme or theme_gray()
1099353
public static void modifyDefaultThemeClear(int mod) {
        mod &= ThemeManager._THEME_MASK;
        ThemeManager._DEFAULT_THEME |= mod;
        ThemeManager._DEFAULT_THEME ^= mod;
    }
481861
def change_options(self, **kwargs):
        '''
        
        '''
        new_options = json.loads(json.dumps(self.viewconf['options']))
        new_options = {**new_options, **kwargs}

        return self.change_attributes(options=new_options)
939116
function updateThemeClass(theme) {
        if (!theme) return;
        if (!registered(theme)) {
          $log.warn('Attempted to use unregistered theme \'' + theme + '\'. ' +
                    'Register it with $mdThemingProvider.theme().');
        }

        var oldTheme = el.data('$mdThemeName');
        if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');
        el.addClass('md-' + theme + '-theme');
        el.data('$mdThemeName', theme);
        if (ctrl) {
          el.data('$mdThemeController', ctrl);
        }
      }
1017773
public function _setActiveTheme()
    {
        if (empty($this->config['theme'])) {
            return;
        }

        if (!is_array($this->config['theme'])) {
            $template   = $this->config['theme'];
            $stylesheet = $this->config['theme'];
        } else {
            $template   = reset($this->config['theme']);
            $stylesheet = end($this->config['theme']);
        }

        $GLOBALS['wp_tests_options']['template']   = $template;
        $GLOBALS['wp_tests_options']['stylesheet'] = $stylesheet;

        codecept_debug('Set template to [' . $template . '] and stylesheet to [' . $stylesheet . ']');
    }
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
1312499
def on_gtk_theme_name_changed(self, combo):
        
        citer = combo.get_active_iter()
        if not citer:
            return
        theme_name = combo.get_model().get_value(citer, 0)
        self.settings.general.set_string('gtk-theme-name', theme_name)
        select_gtk_theme(self.settings)
774784
def _new_theme_part(cls, package):
        
        partname = package.next_partname('/ppt/theme/theme%d.xml')
        content_type = CT.OFC_THEME
        theme = CT_OfficeStyleSheet.new_default()
        return XmlPart(partname, content_type, theme, package)
1116761
def options(self, new):
        
        options = self._create_options(new)
        if self.widget.value:
            self.widget.set_param(options=options, value=list(options.values())[:1])
        else:
            self.widget.options = options
            self.widget.value = list(options.values())[:1]
750873
protected void changeTheme() {
        currentTheme = getNextTheme(currentTheme);
        if (currentTheme != null) {
            currentTheme.setLooping(false);
            currentTheme.setOnCompletionListener(listener);
            currentTheme.setVolume(musicVolume.getPercent());
            currentTheme.play();
        }
    }
341959
def reset_to_default(self):
        """"""
        # Checks that this is indeed a default scheme
        scheme = self.current_scheme
        names = self.get_option('names')
        if scheme in names:
            for key in syntaxhighlighters.COLOR_SCHEME_KEYS:
                option = "{0}/{1}".format(scheme, key)
                value = CONF.get_default(self.CONF_SECTION, option)
                self.set_option(option, value)

            self.load_from_conf()
342463
def create
      # the theme used is set in the settings area - this does the update of the current theme used
      Setting.where("setting_name = 'theme_folder'").update_all('setting' => params[:theme])
      Setting.reload_settings
      respond_to do |format|
        format.html { redirect_to admin_themes_path, notice: I18n.t("controllers.admin.themes.create.flash.success") }
      end
    end
1165169
def set_theme(self, theme):
        
        if theme in THEMES:
            self.palette = THEMES[theme]
            if self._scroll_bar:
                # TODO: fix protected access.
                self._scroll_bar._palette = self.palette
1186526
public function afterSwitchTheme() {
		$this->clearCache();
		foreach ( $this->getTabs() as $slug => $subclass ) {
			/** @var \Pressbooks\Options $subclass (not instantiated, just a string) */
			$current_options = get_option( "pressbooks_theme_options_{$slug}", [] );
			if ( ! empty( $current_options ) ) {
				update_option( "pressbooks_theme_options_{$slug}", $subclass::filterDefaults( $current_options ) );
			}
		}
	}
618970
public static function setup_theme() {

		global $pagenow;

		if ( ( is_admin() && 'themes.php' == $pagenow ) || ! self::can_switch_themes() ) {
			return;
		}

		self::check_reset();
		self::load_cookie();

		if ( empty( self::$theme ) ) {
			return;
		}

		add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
		add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
		add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
		$parent = self::$theme->parent();
		add_filter( 'pre_option_template_root', array( empty( $parent ) ? self::$theme : $parent, 'get_theme_root' ) );
		add_filter( 'pre_option_current_theme', '__return_false' );
	}