Apply the data to configure the theme
336954
public function run()
    {
        $data = $this->getData();

        $defaultProperties = $data['defaults'];
        $areas = $data['areas'];

        foreach ($areas as $slug => $desc)
        {
            // Handle quick declaration style
            if ( !is_array($desc))
            {
                // $desc is actually the title, build an array
                $desc = array('name' => $desc);
            }

            // Set name and description if not specified
            if ( !isset($desc['name']))
            {
                $desc['name'] = Strings::labelizeSlug($slug);
            }
            if ( !isset($desc['description']))
            {
                $desc['description'] = '';
            }

            // Set the slug
            $desc['id'] = $slug;

            // Merge with our default and register
            $areaProperties = array_merge($defaultProperties, $desc);

            // Internationalize what has to be internationalized
            $areaProperties['name'] = Strings::translate($areaProperties['name']);
            $areaProperties['description'] = Strings::translate($areaProperties['description']);

            register_sidebar($areaProperties);
        }
    }
876663
def set_data(self, data):
        """"""
        for key, val in data.items():
            setattr(self, key, val)
        self.uptime['reloaded'] = datetime.now()
850679
public function configure()
    {
        $this->items = [];
        $this->layouts = [];
        $this->includes = [];

        $resolver = $this->createResolver();
        $this->params = $resolver->resolve($this->params);

        switch ($this->params['attribute_syntax']) {
            case 'yaml':
                $this->attributeParser = new AttributeParser(AttributeParser::PARSER_YAML);
                break;
            case 'json':
                $this->attributeParser = new AttributeParser(AttributeParser::PARSER_JSON);
                break;
        }
    }
135918
public static function set_theme() {

		$stylesheet = filter_input( INPUT_GET, 'theme' );
		$theme      = wp_get_theme( $stylesheet );

		if ( $theme->exists() && $theme->is_allowed() ) {
			setcookie( self::get_cookie_name(), $theme->get_stylesheet(), strtotime( '+1 year' ), COOKIEPATH );
		}

		wp_safe_redirect( wp_get_referer() );
		die;
	}
87726
public function init()
    {
        // Check filepath
        if (empty($this->filepath)) {
            return;
        }

        // Get configurations
        $configs = include $this->filepath;

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $props) {
            $props = !is_array($props) && !is_bool($props) ? [$props] : $props;

            if ('post_type' === $key) {
                // Add or Remove post type supports
                $this->addRemovePostTypeSupport($props);
            } else {
                // Add new theme supports
                $this->addRemoveThemeSupport($key, $props);
            }
        }
    }
115771
public function scanThemes()
    {

        $parentThemes = [];
        $themesConfig = config('themes.themes', []);

        foreach ($this->loadThemesJson() as $data) {
            // Are theme settings overriden in config/themes.php?
            if (array_key_exists($data['name'], $themesConfig)) {
                $data = array_merge($data, $themesConfig[$data['name']]);
            }

            // Create theme
            $theme = new Theme(
                $data['name'],
                $data['asset-path'],
                $data['views-path']
            );

            // Has a parent theme? Store parent name to resolve later.
            if ($data['extends']) {
                $parentThemes[$theme->name] = $data['extends'];
            }

            // Load the rest of the values as theme Settings
            $theme->loadSettings($data);
        }

        // Add themes from config/themes.php
        foreach ($themesConfig as $themeName => $themeConfig) {

            // Is it an element with no values?
            if (is_string($themeConfig)) {
                $themeName = $themeConfig;
                $themeConfig = [];
            }

            // Create new or Update existing?
            if (!$this->exists($themeName)) {
                $theme = new Theme($themeName);
            } else {
                $theme = $this->find($themeName);
            }

            // Load Values from config/themes.php
            if (isset($themeConfig['asset-path'])) {
                $theme->assetPath = $themeConfig['asset-path'];
            }

            if (isset($themeConfig['views-path'])) {
                $theme->viewsPath = $themeConfig['views-path'];
            }

            if (isset($themeConfig['extends'])) {
                $parentThemes[$themeName] = $themeConfig['extends'];
            }

            $theme->loadSettings(array_merge($theme->settings, $themeConfig));
        }

        // All themes are loaded. Now we can assign the parents to the child-themes
        foreach ($parentThemes as $childName => $parentName) {
            $child = $this->find($childName);

            if ($this->exists($parentName)) {
                $parent = $this->find($parentName);
            } else {
                $parent = new Theme($parentName);
            }

            $child->setParent($parent);
        }
    }
159342
protected function setUp()
	{
		$tags = [
			'TABLE' => ['template' => '<table><xsl:apply-templates/></table>'],
			'TBODY' => ['template' => '<tbody><xsl:apply-templates/></tbody>'],
			'TD'    => $this->generateCellTagConfig('td'),
			'TH'    => $this->generateCellTagConfig('th'),
			'THEAD' => ['template' => '<thead><xsl:apply-templates/></thead>'],
			'TR'    => ['template' => '<tr><xsl:apply-templates/></tr>']
		];
		foreach ($tags as $tagName => $tagConfig)
		{
			if (!isset($this->configurator->tags[$tagName]))
			{
				$this->configurator->tags->add($tagName, $tagConfig);
			}
		}
	}
790844
public function applyConfig()
    {
        parent::applyConfig();
        $pool = $this;
        if (!isset($this->preloading)) {
            $this->preloading = new ComplexJob();
        }
        $job = $this->preloading;
        $job->addJob('resolvfile', function ($jobname, $job) use ($pool) {
            FileSystem::readfile($pool->config->resolvfile->value, function ($file, $data) use ($pool, $job, $jobname) {
                if ($file) {
                    foreach (explode("\n", $data) as $line) {
                        $line = trim($line);
                        if ($line !== '' && $line[0] !== '#' && preg_match('~nameserver ([^\r\n;]+)~i', $line, $m)) {
                            $pool->nameServers[] = $m[1];
                        }
                    }
                }
                $job->setResult($jobname);
            });
        });
        $job->addJob('hostsfile', function ($jobname, $job) use ($pool) {
            FileSystem::readfile($pool->config->hostsfile->value, function ($file, $data) use ($pool, $job, $jobname) {
                if ($file) {
                    preg_match_all('~^([^#]\S+)\s+([^\r\n]+)\s*~m', $data, $m, PREG_SET_ORDER);
                    $pool->hosts = [];
                    foreach ($m as $h) {
                        $hosts = preg_split('~\s+~', $h[2]);
                        $ip = $h[1];
                        /* skip commentened ips */
                        if (preg_match('~^[\s]*?#~m', $ip)) {
                            continue;
                        }
                        foreach ($hosts as $host) {
                            $host = rtrim($host, '.') . '.';
                            $pool->hosts[$host][] = $ip;
                        }
                    }
                }
                $job->setResult($jobname);
            });
        });
        $job();
    }
112572
function() {
    if (typeof this.themeData !== 'string') {
      if (this.themeFile) {
        this.themeFile = path.resolve(this.cwd, this.themeFile);
        this.themeData = fs.readFileSync(this.themeFile, 'utf-8');
      } else {
        this.loadThemeVars();
        this.themeData = this.varsData;
      }
      this.setThemeVars(this.themeData);
    }
  }
156934
public function configure()
    {
        $name = $this->current();
        $config = $this->config;

        $this->loadConfiguration($name, $config);

        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        $registered = stream_get_wrappers();

        $schemes = $config->get("themes.{$name}.streams.schemes", []);
        $schemes += [
            'theme' => [
                'type' => 'ReadOnlyStream',
                'paths' => $locator->findResources("themes://{$name}", false)
            ]
        ];

        foreach ($schemes as $scheme => $config) {
            if (isset($config['paths'])) {
                $locator->addPath($scheme, '', $config['paths']);
            }
            if (isset($config['prefixes'])) {
                foreach ($config['prefixes'] as $prefix => $paths) {
                    $locator->addPath($scheme, $prefix, $paths);
                }
            }

            if (\in_array($scheme, $registered, true)) {
                stream_wrapper_unregister($scheme);
            }
            $type = !empty($config['type']) ? $config['type'] : 'ReadOnlyStream';
            if ($type[0] !== '\\') {
                $type = '\\RocketTheme\\Toolbox\\StreamWrapper\\' . $type;
            }

            if (!stream_wrapper_register($scheme, $type)) {
                throw new \InvalidArgumentException("Stream '{$type}' could not be initialized.");
            }
        }

        // Load languages after streams has been properly initialized
        $this->loadLanguages($this->config);
    }
1276524
protected function configure(): void
    {
        parent::configure();
        foreach ($this->aArguments as $aArgument) {
            $this->addArgument(
                getFromArray('name', $aArgument),
                getFromArray('mode', $aArgument, InputArgument::OPTIONAL),
                getFromArray('description', $aArgument),
                getFromArray('default', $aArgument)
            );
        }
    }
926389
public function applyData ( $data = NULL ) {
        if (NULL != $data && is_array( $data )) {
            foreach ($data as $propName => $propValue) {
                $this->assignValue( $propName, $propValue );
            }
        } else {
            $this->buildVars();
        }
    }
878103
def _apply_base_theme(app):
    

    if QT_VERSION < (5,):
        app.setStyle('plastique')
    else:
        app.setStyle('Fusion')

    with open(_STYLESHEET) as stylesheet:
        app.setStyleSheet(stylesheet.read())
576609
private function setSettings()
    {
        Settings::setSetting('siteTitle', $this->APP_NAME);
        Settings::setSetting('adminEmail', $this->ADMIN_EMAIL);
        Settings::setSetting('defaultUserRole', 'admin');
        Settings::setSetting('timezone', $this->TIMEZONE);
        Settings::setSetting('logo', 1);
        Settings::setSetting('activeTheme', config('project.defaultTheme'));
        Settings::setSetting('activateMobileTheme', false);
        Settings::setSetting('mobileActiveTheme', '');
        Settings::setSetting('trackingCode', '');
        Settings::setSetting('useTagManager', 0);
        Settings::setSetting('tagManager', '');
        Settings::setSetting('watermark', '');

        $language = Language::where('isDefault', 1)->first();
        Settings::setSetting('defaultLanguage', $language->languageID);
    }
972030
protected function setThemeConstants()
    {
        $this->parsedHeaders = $this->headers($this->dirPath.'/style.css', $this->headers);

        // Theme text domain.
        $textdomain = (isset($this->parsedHeaders['text_domain']) && ! empty($this->parsedHeaders['text_domain']))
            ? $this->parsedHeaders['text_domain']
            : 'themosis_theme';

        defined('THEME_TD') ? THEME_TD : define('THEME_TD', $textdomain);
    }
52459
public function themeEditor()
    {
        $this->setTitleThemeEditor();
        $this->setBreadcrumbThemeEditor();
        $this->setData('themes', $this->module->getByType('theme'));
        $this->outputThemeEditor();
    }
339228
def setup_data(self, data, params):
        
        check_required_aesthetics(
            self.REQUIRED_AES,
            data.columns,
            self.__class__.__name__)
        return data