Set bool runtime value with re-authenticate if needed
961041
def set_runtime_value_bool(self, ihcid: int, value: bool) -> bool:
        
        if self.client.set_runtime_value_bool(ihcid, value):
            return True
        self.re_authenticate()
        return self.client.set_runtime_value_bool(ihcid, value)
965573
function (boolActivateUnsecure) {
        if (cordova.platformId == 'android')
            cordova.exec(null, null, 'CertificatesPlugin', 'setUntrusted', [boolActivateUnsecure]);
        else
            cordova.exec(null, null, 'CDVCertificate', 'setUntrusted', [boolActivateUnsecure]);
    }
209547
function validateBoolean(context, name, def) {
  var value = context[name]

  if (value == null) {
    value = def
  }

  if (typeof value !== 'boolean') {
    raise(value, 'options.' + name)
  }

  context[name] = value
}
491263
def set_autoclear(self, value, auth_no_user_interaction=None):
        """"""
        return self._M.Loop.SetAutoclear(
            '(ba{sv})',
            value,
            filter_opt({
                'auth.no_user_interaction': ('b', auth_no_user_interaction),
            })
        )
532326
def set_status(self, value):
        """"""
        self._check_object_exists()
        DB.set_hash_value(self.key, 'status', value)
        self.publish('status_changed', event_data=dict(status=value))
117900
def get_bool(self, key, default=None):
        
        v = self.get(key, default)
        if v != default:
            v = v.strip().lower()
            if v == 'true':
                v = True
            elif v == 'false':
                v = False
            elif default is None:
                raise RuntimeError("invalid bool string: %s" % v)
            else:
                v = default
        return v
8237
function (context, run, done) {
        // if no response is provided, there's nothing to do, and probably means that the request errored out
        // let the actual request command handle whatever needs to be done.
        if (!context.response) { return done(); }

        // bail out if there is no auth
        if (!(context.auth && context.auth.type)) { return done(); }

        var auth = context.auth,
            originalAuth = context.originalItem.getAuth(),
            originalAuthParams = originalAuth && originalAuth.parameters(),
            authHandler = AuthLoader.getHandler(auth.type),
            authInterface = createAuthInterface(auth);

        // bail out if there is no matching auth handler for the type
        if (!authHandler) {
            run.triggers.console(context.coords, 'warn', 'runtime: could not find a handler for auth: ' + auth.type);

            return done();
        }

        // invoke `post` on the Auth
        authHandler.post(authInterface, context.response, function (err, success) {
            // sync all auth system parameters to the original auth
            originalAuthParams && auth.parameters().each(function (param) {
                param && param.system && originalAuthParams.upsert({key: param.key, value: param.value, system: true});
            });

            // sync auth state back to item request
            _.set(context, 'item.request.auth', auth);

            // there was an error in auth post hook
            // warn the user but don't bubble it up
            if (err) {
                run.triggers.console(
                    context.coords,
                    'warn',
                    'runtime~' + auth.type + '.auth: there was an error validating auth: ' + (err.message || err),
                    err
                );

                return done();
            }

            // auth was verified
            if (success) { return done(); }

            // request a replay of request
            done(null, {replay: true, helper: auth.type + DOT_AUTH});
        });
    }
889478
def authenticated(function):
    """"""
    def wrapped(*args):
        """Wrap function."""
        try:
            return function(*args)
        except UPSError:
            _login(*args)
            return function(*args)
    return wrapped
186801
def RunOnce(self):
    """"""
    global WEBAUTH_MANAGER  # pylint: disable=global-statement

    # pylint: disable=g-bad-name
    WEBAUTH_MANAGER = BaseWebAuthManager.GetPlugin(
        config.CONFIG["AdminUI.webauth_manager"])()

    # pylint: enable=g-bad-name
    logging.info("Using webauth manager %s", WEBAUTH_MANAGER)
1156231
function toBoolean(value)
    {
        var result = { "true" : true, "false" : false }[value];
        return result == null ? value : result;
    }
458900
static public function reenable( $reactivate=false )
    {
        self::$has_run = false;
        if ( $reactivate )
        {
            self::$activated = true;
        }
    }
1218542
def authenticated(viewfunc):
    """"""
    @wraps(viewfunc)
    def wrapper(*args, **kwargs):
        ctx = stack.top
        if ctx and hasattr(ctx, 'htauth'):
            auth_header = request.headers.get('Authorization', None)
            if not auth_header:
                return _unauthorized_response()

            if not auth_header.startswith('Basic '):
                raise RuntimeError('Flask-HTAuth supports only Basic auth.')

            auth_header = auth_header.replace('Basic ', '')
            auth_header = base64.b64decode(auth_header)
            username, password = auth_header.split(':', 1)

            if not username in ctx.htauth['users']:
                return _unauthorized_response()

            if not check_password(password, ctx.htauth['users'][username]):
                return _unauthorized_response()

            g.htauth_user = username

        return viewfunc(*args, **kwargs)

    return wrapper
1020517
def verify_host_key_value(given)
      current_net_ssh = Net::SSH::Version::CURRENT
      new_value_version = Net::SSH::Version[5, 0, 0]
      if current_net_ssh >= new_value_version
        # 5.0+ style
        {
          # It's not a boolean anymore.
          'true' => :always,
          'false' => :never,
          true => :always,
          false => :never,
          # May be correct value, but strings from JSON config
          'always' => :always,
          'never' => :never,
          nil => :never,
        }.fetch(given, given)
      else
        # up to 4.2 style
        {
          'true' => true,
          'false' => false,
          nil => false,
        }.fetch(given, given)
      end
    end
959216
def validate_login(ctx, param, value):
    """"""
    # pylint: disable=unused-argument
    value = value.strip()
    if not value:
        raise click.BadParameter("The value cannot be blank.", param=param)
    return value
933339
def _set_trusted_option_if_needed(repostr, trusted):
    '''
    
    '''
    if trusted is True:
        repostr += ' [trusted=yes]'
    elif trusted is False:
        repostr += ' [trusted=no]'
    return repostr
665689
def __convert_bool(node):
    """"""
    converted = __convert_node(node, default_value='true')

    # Check for a switch for reversing the value
    reverse_switch = __get_attribute(node, 'ReverseSwitch')

    if reverse_switch:
        converted_reverse = copy.deepcopy(converted)

        converted_reverse['switch'] = reverse_switch
        converted_reverse['value'] = 'false'

        return [converted_reverse, converted]

    # Modify flags when there is an argument child
    __with_argument(node, converted)

    return __check_for_flag(converted)
1048412
function(req, user){
      req.session.authenticated = true;
      req.session.user = user;
    }