Set opt out flag. If it is true, the rate dialog will never shown unless app data is cleared.
160770
public static void setOptOut(final Context context, boolean optOut) {
        SharedPreferences pref = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
        Editor editor = pref.edit();
        editor.putBoolean(KEY_OPT_OUT, optOut);
        editor.apply();
    }
654998
function only(opts) {
        mocha.options.hasOnly = true;
        opts.isOnly = true;
        return this.create(opts);
      }
1221413
def should_register(self, app):
        
        if self.only_if is None:
            return True
        elif callable(self.only_if):
            return self.only_if(app)
        return bool(self.only_if)
171001
function choiceListener(index) {
  return function (event) {
    event.preventDefault();
    if (choicesAnimating) return;
    clearChoiceListeners();
    story.ChooseChoiceIndex(index);
    saveGame(index);
    clearOldChoices().then(() => progressGame());
  }
}
40331
function isOptOut() {
  // Check cookie first
  let optOutState = getCookie();

  // No cookie info, check localStorage
  if (optOutState === null) {
    optOutState = getLocalStorage();
  }

  // No localStorage, we get default value
  if (optOutState === null || typeof optOutState === 'undefined') {
    optOutState = false;
  }

  // Set global for the environment
  window[disableStr] = optOutState;

  return optOutState;
}
1117775
def set_blocking(fd, blocking=True):
    

    old_flag = fcntl.fcntl(fd, fcntl.F_GETFL)

    if blocking:
        new_flag = old_flag & ~ os.O_NONBLOCK
    else:
        new_flag = old_flag | os.O_NONBLOCK

    fcntl.fcntl(fd, fcntl.F_SETFL, new_flag)

    return not bool(old_flag & os.O_NONBLOCK)
441584
private void overAttributeChoice(CmsAttributeChoiceWidget choice) {

        cancelChoiceTimer();
        if (choice.getParent() != m_buttonBar) {
            closeAll();
            m_buttonBar = choice.getParent();
            setButtonBarVisibility(m_buttonBar, true);
        }
        if (m_choice != choice) {
            closeAllChoices();
            m_choice = choice;
            m_choice.show();
        }
    }
549447
public void setEnabled(boolean enabled) {
		super.setEnabled(enabled);

		if (dayChooser != null) {
			dayChooser.setEnabled(enabled);
			monthChooser.setEnabled(enabled);
			yearChooser.setEnabled(enabled);
		}
	}
101990
def _set_option(self, name, value, allow_clear=False):
        """"""
        if not allow_clear:
            # Prevent clears if value was set
            try:
                current_value = self._get_option(name)
                if value is None and current_value is not None:
                    return
            except AttributeError:
                pass

        self.opts[name] = value
855738
def set_show_only_status(self):
        
        if self.ui.chkBoxShowOnlyDiffs.isChecked() and not self.ui.cbShowDiffs.isChecked():
            self.ui.cbShowDiffs.setChecked(True)
            self.show_differences(True)

        if self.ui.chkBoxOnlyShowLabelsInProtocol.isChecked() and self.ui.chkBoxShowOnlyDiffs.isChecked():
            self.show_only_diffs_and_labels()
        elif self.ui.chkBoxOnlyShowLabelsInProtocol.isChecked() and not self.ui.chkBoxShowOnlyDiffs.isChecked():
            self.show_only_labels()
        elif not self.ui.chkBoxOnlyShowLabelsInProtocol.isChecked() and self.ui.chkBoxShowOnlyDiffs.isChecked():
            self.show_only_diffs()
        else:
            self.restore_visibility()

        self.ui.tblViewProtocol.resize_columns()
881534
def _callback_set_qs_value(self, key, val, success):
        """"""
        set_url = URL_SET.format(self._url, key, val)
        with self._lock:
            for _repeat in range(1, 6):
                set_result = requests.get(set_url)
                if set_result.status_code == 200:
                    set_result = set_result.json()
                    if set_result.get('data', 'NO REPLY') != 'NO REPLY':
                        # self.devices._set_qs_value(key, set_result['data'])
                        success()
                        return True
                sleep(0.01 * _repeat)
        _LOGGER.error("Unable to set %s", set_url)
        return False
741593
def ok(self, *args, cb=None):
        """"""
        self.clear_widgets()
        if cb:
            cb()
        self.idx += 1
        self.advance_dialog()
546446
function RateLimiter(options) {
  this.startTime = _.now();
  this.counter = 0;
  this.perMinCounter = 0;
  this.platform = null;
  this.platformOptions = {};
  this.configureGlobal(options);
}
953962
def DeactivateCard(self, card):
        """"""
        if hasattr(card, 'connection'):
            card.connection.disconnect()
            if None != self.parent.apdutracerpanel:
                card.connection.deleteObserver(self.parent.apdutracerpanel)
            delattr(card, 'connection')
        self.dialogpanel.OnDeactivateCard(card)
1003888
private boolean shouldHeaderBeShown() {
        SharedPreferences sharedPreferences =
                PreferenceManager.getDefaultSharedPreferences(getActivity());
        String key = getString(R.string.show_dialog_header_preference_key);
        boolean defaultValue =
                getResources().getBoolean(R.bool.show_dialog_header_preference_default_value);
        return sharedPreferences.getBoolean(key, defaultValue);
    }
85674
def optout_saved(sender, instance, **kwargs):
    
    if instance.identity is None:
        # look up using the address_type and address
        identities = Identity.objects.filter_by_addr(
            instance.address_type, instance.address
        )
        if identities.count() == 1:
            instance.identity = identities[0]
1238286
def stop_choose(self):
        """"""
        if self.choosed:
            self.choosed = False
            self.pos = self.pos + Sep(-5, 0)