set the viewer preferences of the document, it is up to the browser to obey these.
517617
function setPreferences( $label, $value = 0 )
    {
        // this will only work if the label is one of the valid ones.
        if ( is_array( $label ) )
        {
            foreach ( $label as $l => $v )
            {
                $this->o_catalog( $this->catalogId, 'viewerPreferences', array( $l => $v ) );
            }
        }
        else
        {
            $this->o_catalog( $this->catalogId, 'viewerPreferences', array( $label => $value ) );
        }
    }
295019
def configure(self, options, conf):
        
        self.conf = conf
        self.when = options.browser_closer_when
311656
public function setReadOnly()
    {
        $this->_allowModifications = false;
        foreach ($this->_data as $key => $value) {
            if ($value instanceof Zend_Config) {
                $value->setReadOnly();
            }
        }
    }
801352
def set_settings(self, subreddit, title, public_description='',
                     description='', language='en', subreddit_type='public',
                     content_options='any', over_18=False, default_set=True,
                     show_media=False, domain='', domain_css=False,
                     domain_sidebar=False, header_hover_text='',
                     wikimode='disabled', wiki_edit_age=30,
                     wiki_edit_karma=100,
                     submit_link_label='', submit_text_label='',
                     exclude_banned_modqueue=False, comment_score_hide_mins=0,
                     public_traffic=False, collapse_deleted_comments=False,
                     spam_comments='low', spam_links='high',
                     spam_selfposts='high', submit_text='',
                     hide_ads=False, suggested_comment_sort='',
                     key_color='',
                     **kwargs):
        
        data = {'sr': subreddit.fullname,
                'allow_top': default_set,
                'comment_score_hide_mins': comment_score_hide_mins,
                'collapse_deleted_comments': collapse_deleted_comments,
                'description': description,
                'domain': domain or '',
                'domain_css': domain_css,
                'domain_sidebar': domain_sidebar,
                'exclude_banned_modqueue': exclude_banned_modqueue,
                'header-title': header_hover_text or '',
                'hide_ads': hide_ads,
                'key_color': key_color,
                'lang': language,
                'link_type': content_options,
                'over_18': over_18,
                'public_description': public_description,
                'public_traffic': public_traffic,
                'show_media': show_media,
                'submit_link_label': submit_link_label or '',
                'submit_text': submit_text,
                'submit_text_label': submit_text_label or '',
                'suggested_comment_sort': suggested_comment_sort or '',
                'spam_comments': spam_comments,
                'spam_links': spam_links,
                'spam_selfposts': spam_selfposts,
                'title': title,
                'type': subreddit_type,
                'wiki_edit_age': six.text_type(wiki_edit_age),
                'wiki_edit_karma': six.text_type(wiki_edit_karma),
                'wikimode': wikimode}

        if kwargs:
            msg = 'Extra settings fields: {0}'.format(kwargs.keys())
            warn_explicit(msg, UserWarning, '', 0)
            data.update(kwargs)
        evict = self.config['subreddit_settings'].format(
            subreddit=six.text_type(subreddit))
        self.evict(evict)
        return self.request_json(self.config['site_admin'], data=data)
752131
def _maybe_add_read_preference(spec, read_preference):
    """"""
    mode = read_preference.mode
    tag_sets = read_preference.tag_sets
    max_staleness = read_preference.max_staleness
    # Only add $readPreference if it's something other than primary to avoid
    # problems with mongos versions that don't support read preferences. Also,
    # for maximum backwards compatibility, don't add $readPreference for
    # secondaryPreferred unless tags or maxStalenessSeconds are in use (setting
    # the slaveOkay bit has the same effect).
    if mode and (
        mode != ReadPreference.SECONDARY_PREFERRED.mode
        or tag_sets != [{}]
        or max_staleness != -1):

        if "$query" not in spec:
            spec = SON([("$query", spec)])
        spec["$readPreference"] = read_preference.document
    return spec
1125358
def set_preferences(self, user=None, **kwargs):
        """"""
        if user is None:
            user = current_user

        d = {pref.key: pref for pref in user.preferences}
        for k, v in kwargs.items():
            if k in d:
                d[k].value = v
            else:
                d[k] = UserPreference(user=user, key=k, value=v)
                db.session.add(d[k])
1256754
function( opacity ) {
        if ( this.element[ $.SIGNAL ] && $.Browser.vendor == $.BROWSERS.IE ) {
            $.setElementOpacity( this.element, opacity, true );
        } else {
            $.setElementOpacity( this.wrapper, opacity, true );
        }
    }
71106
public void setBrowsers(com.google.api.ads.admanager.axis.v201805.Technology[] browsers) {
        this.browsers = browsers;
    }
981363
protected function setViewHelpers()
    {
        $this->set('token', $this->app->make('token'));
        $this->set('form', $this->app->make('helper/form'));
        $this->set('ui', $this->app->make('helper/concrete/ui'));
        $this->set('resolverManager', $this->app->make(ResolverManagerInterface::class));
    }
175375
private void setViewsVisibility() {

		if (mSeekBar != null) {
			mSeekBar.setVisibility(View.VISIBLE);
		}

		if (mPlaybackTime != null) {
			mPlaybackTime.setVisibility(View.VISIBLE);
		}

		if (mRunTime != null) {
			mRunTime.setVisibility(View.VISIBLE);
		}

		if (mTotalTime != null) {
			mTotalTime.setVisibility(View.VISIBLE);
		}

		if (mPlayButton != null) {
			mPlayButton.setVisibility(View.VISIBLE);
		}

		if (mPauseButton != null) {
			mPauseButton.setVisibility(View.VISIBLE);
		}
	}
172362
private void initializeFullscreenPreference() {
        Preference fullscreenPreference =
                findPreference(getString(R.string.fullscreen_preference_key));
        fullscreenPreference.setOnPreferenceChangeListener(createThemeChangeListener());
    }
64736
protected void setButtonVisibility() {

        Component tab = m_tab.getSelectedTab();
        int pos = m_tab.getTabPosition(m_tab.getTab(tab));
        //TODO: check if necessary (when it was finally known which tabs web ou users should see..
        int maxPos = m_isWebOU ? 3 : 3; //has to be changed if number of tabs is changed for web OU user
        m_next.setVisible(pos < maxPos);
        m_ok.setVisible(pos == maxPos);
    }
1298714
private void initializeShowEditTextDialogPreference() {
        Preference preference =
                findPreference(getString(R.string.show_edit_text_dialog_preference_key));
        preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

            @Override
            public boolean onPreferenceClick(final Preference preference) {
                initializeEditTextDialog();
                editTextDialog.setShowAnimation(createRectangularRevealAnimation(preference));
                editTextDialog.setDismissAnimation(createRectangularRevealAnimation(preference));
                editTextDialog.setCancelAnimation(createRectangularRevealAnimation(preference));
                editTextDialog.show();
                return true;
            }

        });
    }
71861
protected function setDefaults()
    {
        if (!isset($this->contentOptions['category']) 
                || (isset($this->contentOptions['category']) 
                        && empty($this->contentOptions['category']))) {
            $this->contentOptions['category'] = 'app';
        }
        if (!isset($this->contentOptions['mainParams'])) {
            $this->contentOptions['mainParams'] = [];
        }
        if (!isset($this->contentOptions['buttonParams'])) {
            $this->contentOptions['buttonParams'] = [];
        }
        if (!isset($this->contentOptions['language'])) {
            $this->contentOptions['language'] = null;
        }
        if (!isset($this->contentOptions['mainMessage'])) {
            $this->contentOptions['mainMessage'] = 'We use cookies on our websites to help us offer you the best online experience. By continuing to use our website, you are agreeing to our use of cookies. Alternatively, you can manage them in your browser settings.';
        }
        if (!isset($this->contentOptions['buttonMessage'])) {
            $this->contentOptions['buttonMessage'] = 'I understand';
        }
        if (!isset($this->cookieOptions['path'])) {
            $this->cookieOptions['path'] = '/';
        }
        if (!isset($this->cookieOptions['expires'])) {
            $this->cookieOptions['expires'] = 30;
        }
        if (!isset($this->cookieOptions['secure'])) {
            $this->cookieOptions['secure'] = false;
        }
        if (!isset($this->classOptions['classOuter'])) {
            $this->classOptions['classOuter'] = 'CookieMonsterBox';
        }
        if (!isset($this->classOptions['classInner'])) {
            $this->classOptions['classInner'] = '';
        }
        if (!isset($this->classOptions['classButton'])) {
            $this->classOptions['classButton'] = 'CookieMonsterOk';
        }
    }
734394
def _set_choices(self, value):
        
        super(LazyChoicesMixin, self)._set_choices(value)
        self.widget.choices = value
58105
def set_open_viewing(self, open_viewing):
        
        if open_viewing:
            self._open_viewing = open_viewing
            self._query_params += str(QueryParam.OPEN_VIEWING)
326816
private function setBrowser()
    {
        $client = parse_user_agent($this->detector->getUserAgent());
        $this->browser = $client['browser'];
        $this->setPlatform($client['platform']);

        return $this;
    }