Indicates if the remote is seen as trusted. This
 setting can be changed by the application.
 @param val [Boolean]
 @return [void]
558700
def trusted=(val)
      if ! [ true, false ].include?(val)
        raise ArgumentError, "value must be a boolean"
      end
      @o_dev[I_DEVICE]['Trusted'] = val
    end
99094
def unauthenticated(scope=nil)
      constraint = lambda do |request|
        not request.env["warden"].authenticate? :scope => scope
      end

      constraints(constraint) do
        yield
      end
    end
956865
def validate(self, val):
        

        if self.nullable and val is None:
            return
        type_er = self.__type_check(val)
        if type_er:
            return type_er

        spec_err = self._specific_validation(val)
        if spec_err:
            return spec_err
1090995
def checksum_type=(new_val)
      return if new_val == @checksum_type
      raise JSS::InvalidDataError, "Checksum type must be one of: #{CHECKSUM_HASH_TYPES.keys.join ', '} " unless CHECKSUM_HASH_TYPES.key? new_val

      @checksum_type = new_val
      @need_to_update = true
    end
991819
def valid?(value)
      # we also allow nil values, which do not have to be verified.
      return true if value.nil?

      # Verify that value is the type that we're expecting, if we are expecting a type
      if data_type == Fastlane::Boolean
        ensure_boolean_type_passes_validation(value)
      else
        ensure_generic_type_passes_validation(value)
      end

      if @verify_block
        begin
          @verify_block.call(value)
        rescue => ex
          UI.error("Error setting value '#{value}' for option '#{@key}'")
          raise Interface::FastlaneError.new, ex.to_s
        end
      end

      true
    end
363490
def value=(val)
      case val
      when ::String     then @value = val.to_s
      when ::Hash       then @value = val
      when ::Array      then @value = val
      when ::OpenStruct then @value = val
      when ::DateTime   then @value = val.strftime XS_DATETIME_FORMAT
      when ::Time       then @value = val.strftime XS_DATETIME_FORMAT
      when ::Date       then @value = val.strftime XS_DATETIME_FORMAT
      else
        if val.respond_to?(:to_datetime)
          @value = val.to_datetime
        elsif val.respond_to?(:call)
          @value = val.call
        elsif val.nil?
          @value = nil
        else
          @value = val.to_s
        end
      end
    rescue => e
      @value = val.to_s
    end
671733
public static function isISODate($val)
    {
        if(!is_string($val)) {
            return false;
        }

        // Use DateTime support to check for valid dates.
        try
        {
            $date = new DateTime($val);
        }
        catch(Exception $e)
        {
            return false;
        }

        return true;
    }
967659
function (val) {
            var rv = false;

            if (JS.isNumber(val)) {
                rv = val > 0 && val <= this.get("numItems");
            } else if (JS.isArray(val)) {
                if (JS.isNumber(val[0]) && JS.isNumber(val[1])) {
                    rv = val[0] * val[1] > 0 && val.length == 2;
                }
            }

            return rv;
        }
773034
protected function validate_scale($val) {
        global $COURSE;
        $scales = get_scales_menu($COURSE->id);
        return (!empty($val) && isset($scales[(int)$val])) ? true : false;
    }
306182
public final void setIsSyntheticBlock(boolean val) {
    checkState(token == Token.BLOCK);
    putBooleanProp(Prop.SYNTHETIC, val);
  }
213118
public static function boolean($val): bool
    {
        if (!\is_scalar($val)) {
            return false;
        }

        // $ret = filter_var($val, \FILTER_VALIDATE_BOOLEAN, $settings);
        if (($val = (string)$val) === '') {
            return true;
        }

        return false !== \stripos(Helper::IS_BOOL, '|' . $val . '|');
    }
1256486
def universal_validation_checks (data, options={})
      # shortcircuit if debugging
      return true if RubyMotionQuery::RMQ.debugging?
      # allow blank data if specified
      return true if (options[:allow_blank] && (data.nil? || data.empty?))
      # allow whitelist data if specified
      return true if (options[:white_list] && options[:white_list].include?(data))

      false
    end
90879
def sync=(sync)
      validator = EnumAttributeValidator.new('String', ["true", "false"])
      unless validator.valid?(sync)
        fail ArgumentError, "invalid value for 'sync', must be one of #{validator.allowable_values}."
      end
      @sync = sync
    end
1047538
def removeRemote(self, remote: Remote, clear=True):
        
        name = remote.name
        pkey = remote.publicKey
        vkey = remote.verKey
        if name in self.remotes:
            self.remotes.pop(name)
            self.remotesByKeys.pop(pkey, None)
            self.verifiers.pop(vkey, None)
        else:
            logger.info('No remote named {} present')
1205479
def self_service_reminders_enabled=(new_val)
      return if new_val == self_service_reminders_enabled
      validate_notification_reminders_supported
      JSS::Validate.boolean new_val
      @self_service_reminders_enabled = new_val
      @need_to_update = true
    end
1071884
public static function isPrime($val = null)
    {
        if (is_null($val)) {
            return null;
        }
        if (
            ($val<=1) ||
            ($val>2 && ($val%2)===0)
        ) {
            return false;
        }
        for ($i=2;$i<$val;$i++) {
            if (($val%$i)===0) {
                return false;
            }
        }
        return true;
    }
784433
function has (array, val) {
  var rtn = false;
  if (Array.isArray(array)) {
    rtn = !!~array.indexOf(val);
  }
  return rtn;
}