Confirm only allowed settings are present.
320208
def _validate_allowed_settings(self, application_id, application_config, allowed_settings):
		""""""

		for setting_key in application_config.keys():
			if setting_key not in allowed_settings:
				raise ImproperlyConfigured(
					"Platform {}, app {} does not support the setting: {}.".format(
						application_config["PLATFORM"], application_id, setting_key
					)
				)
1304270
private boolean isTilingViewAllowed() {

        if (m_types.size() == 0) {
            return false;
        }
        for (String typeName : m_types) {
            if (!isImagelikeType(typeName)) {
                return false;
            }
        }
        return true;

    }
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()
268448
def _set_allowed_services_and_actions(self, services):
        """"""
        for service in services:
            self.services[service['name']] = {}

            for action in service['actions']:
                name = action.pop('name')
                self.services[service['name']][name] = action
1015074
def isAuthorized(self, request):
        
        restrictions = self.get_view_restrictions()
        if restrictions and request is None:
            return False
        else:
            return all(restriction.accept_request(request)
                       for restriction in restrictions)
887814
def global_permission_set(self):
        ''''''
        only_admins_create_admins = Or(
            AllowAdmin,
            And(
                ObjAttrTrue(
                    lambda r, _: r.data.get('admin') is not True),
                Or(
                    AllowPermission('org:admin')
                )
            )
        )

        return And(
            AllowOnlyAuthenticated,
            Or(
                Not(AllowCreate),
                only_admins_create_admins
            )
        )
1076583
def allowed(self):
        '''
        
        '''
        # Expire old keys (hits)
        expires = time.time() - self.window
        self.redis_conn.zremrangebyscore(self.window_key, '-inf', expires)

        # check if we are hitting too fast for moderation
        if self.moderation:
            with self.redis_conn.pipeline() as pipe:
                try:
                    pipe.watch(self.moderate_key)  # ---- LOCK
                    # from this point onward if no errors are raised we
                    # successfully incremented the counter

                    curr_time = time.time()
                    if self.is_moderated(curr_time, pipe) and not \
                            self.check_elastic():
                        return False

                    # passed the moderation limit, now check time window
                    # If we have less keys than max, update out moderate key
                    if self.test_hits():
                        # this is a valid transaction, set the new time
                        pipe.multi()
                        pipe.set(name=self.moderate_key,
                                 value=str(curr_time),
                                 ex=int(self.window * 2))
                        pipe.execute()
                        return True

                except WatchError:
                    # watch was changed, another thread just incremented
                    # the value
                    return False

        # If we currently have more keys than max,
        # then limit the action
        else:
            return self.test_hits()

        return False
62135
def do_not_disturb(self):
        """"""
        return bool(strtobool(str(self._settings_json.get(
            CONST.SETTINGS_DO_NOT_DISTURB))))
348325
def disable():
        """"""
        if os.name != 'nt' or not Windows.is_enabled():
            return False

        getattr(sys.stderr, '_reset_colors', lambda: False)()
        getattr(sys.stdout, '_reset_colors', lambda: False)()

        if isinstance(sys.stderr, _WindowsStream):
            sys.stderr = getattr(sys.stderr, 'original_stream')
        if isinstance(sys.stderr, _WindowsStream):
            sys.stdout = getattr(sys.stdout, 'original_stream')

        return True
782234
def all_checks_enabled(self):
        ''' '''
        arming_mask = int(self.get_mav_param("ARMING_CHECK",0))
        if arming_mask == 1:
            return True
        for bit in arming_masks.values():
            if not arming_mask & bit and bit != 1:
                return False
        return True
783696
public static boolean allowInstance(Settings settings, Object object) {

        Preconditions.checkNotNull(object, "Can not check runtime permissions on a null instance!");

        if (object instanceof Method) {
            return allowMethod(settings, (Method) object);
        }

        return allowClass(settings, object.getClass());
    }
191595
function isAvailableBehavior(behaviorToCheck, e, settings) {
    var setting = settings[behaviorToCheck];
    return !behaviorToCheck || (
        setting && (!zrUtil.isString(setting) || e.event[setting + 'Key'])
    );
}
820531
def required_permission(f, level):
    """"""

    @functools.wraps(f)
    def wrapper(request, pid, *args, **kwargs):
        d1_gmn.app.auth.assert_allowed(request, level, pid)
        return f(request, pid, *args, **kwargs)

    return wrapper
552619
def close_allowed(self) -> bool:
        """"""
        return next(
            attr['Value'] for attr in self._device_json.get('Attributes', [])
            if attr.get('AttributeDisplayName') == 'isunattendedcloseallowed')\
            == "1"
813096
def set_settings(key, value):
    """"""
    with Database("settings") as settings:
        if value in ['0', 'false', 'no', 'off', 'False']:
            del settings[key]
            print("Disabled setting")
        else:
            print(value)
            settings[key] = value
            print("Setting saved")
657477
def set_strict(self, value):
        
        assert isinstance(value, bool)
        self.__settings.set_strict(value)
433280
function(opts, fm) {
				if (fm.UA.ltIE10 || !fm.options.cdns.simplemde) {
					this.disabled = true;
				}
			}