Validate If-Modified-Since with current request conditions.
772525
def check_if_modified_since(self, dt, etag=None):
        """"""
        dt = dt.replace(microsecond=0)
        if request.if_modified_since and dt <= request.if_modified_since:
            raise SameContentException(etag, last_modified=dt)
970283
def update(self):
        '''
        
        '''
        conditionalRequestHeader = dict()
        if self.etag is not None:
            conditionalRequestHeader[Consts.REQ_IF_NONE_MATCH] = self.etag
        if self.last_modified is not None:
            conditionalRequestHeader[Consts.REQ_IF_MODIFIED_SINCE] = self.last_modified

        status, responseHeaders, output = self._requester.requestJson(
            "GET",
            self._url.value,
            headers=conditionalRequestHeader
        )
        if status == 304:
            return False
        else:
            headers, data = self._requester._Requester__check(status, responseHeaders, output)
            self._storeAndUseAttributes(headers, data)
            self.__completed = True
            return True
306245
def detect_old(data):
    ""
    if not data:
        return False
    ok, errors, warnings = _schema.validate(_OLD_SCHEMA, data)
    return ok and not (errors or warnings)
212499
function checkRequired(opts, queryObject, updatedObject){
  if((queryObject &&!queryObject.options) && !updatedObject){
    return;
  }
  const { __user: user, __reason: reason } = queryObject && queryObject.options || updatedObject;
  if (opts.required && (opts.required.includes("user") && !user ||
      opts.required.includes("reason") && !reason)
  ){
    return true;
  }
}
472800
def _validate_if_patch_supported(self, headers, uri):
        """"""
        if not self._operation_allowed(headers, 'PATCH'):
                msg = ('PATCH Operation not supported on the resource '
                       '"%s"' % uri)
                raise exception.IloError(msg)
1090737
def validate_condition!(condition, tag)
      tag = VersionString.new(tag)
      tag.validate!("The version condition, #{condition}, is not valid!")
      tag
    end
632394
def set_added_since(self, added):
        
        self._query_params += str(QueryParam.DAYS_OLD) + str(added)
543658
def on_post(self, req, resp, **kwargs):
        """"""
        validated = self.require_validated(req)

        return super().on_post(
            req, resp,
            handler=partial(self._create, validated=validated),
            **kwargs
        )
27359
private function validate()
    {
        if ($this->hasValidated) {
            return;
        }

        $this->checkDepth();

        foreach ($this->schema as $rule => $parameter) {
            $this->currentKeyword   = $rule;
            $this->currentParameter = $parameter;
            $this->mergeErrors($this->validateRule($rule, $parameter));
            $this->currentKeyword = $this->currentParameter = null;
        }

        $this->hasValidated = true;
    }
812091
function _validate_offset ($current_row) {
		if ( $this->sort_by === null && $this->offset !== null && $current_row < $this->offset ) return false;
		return true;
	}
68367
def validate(self):
        """"""
        try:
            for pkg in self.resolved_packages:
                pkg.validate_data()
        except RezError as e:
            raise ResolvedContextError("%s: %s" % (e.__class__.__name__, str(e)))
1274048
def validate_callback(callback):
    
    if not(hasattr(callback, '_validated')) or callback._validated == False:
        assert hasattr(callback, 'on_loop_start') \
               or hasattr(callback, 'on_loop_end'), \
               'callback must have `on_loop_start` or `on_loop_end` method'
        if hasattr(callback, 'on_loop_start'):
            setattr(callback, 'on_loop_start',
                    validate_callback_data(callback.on_loop_start))
        if hasattr(callback, 'on_loop_end'):
            setattr(callback, 'on_loop_end',
                    validate_callback_data(callback.on_loop_end))
        setattr(callback, '_validated', True)
    return callback
921736
def _validated(self, data):
        """"""
        try:
            return self.convert(data)
        except (TypeError, ValueError) as ex:
            raise NotValid(*ex.args)
1347214
def validate(self):
        

        try:
            resp = self.request().get(self.validate_url, verify=self.verifySSL).json()
        except TokenExpiredError:
            return False
        except AttributeError:
            return False

        if 'error' in resp:
            return False
        return True
1216217
def validate(self):
        """"""
        try:
            response = self.client.get_access_key_last_used(
                AccessKeyId=self.access_key_id
            )

            username = response['UserName']
            access_keys = self.client.list_access_keys(
                UserName=username
            )

            for key in access_keys['AccessKeyMetadata']:
                if \
                        (key['AccessKeyId'] == self.access_key_id)\
                        and (key['Status'] == 'Inactive'):
                    return True

            return False
        except Exception as e:
            logger.info(
                "Failed to validate key disable for "
                "key {id} due to: {e}.".format(
                    e=e, id=self.access_key_id
                )
            )
            return False
161213
def last_modified(self, last_modified):
        """"""
        self._indicator_data['lastModified'] = self._utils.format_datetime(
            last_modified, date_format='%Y-%m-%dT%H:%M:%SZ'
        )
956196
def validate_and_handle(self, cli, buffer):
        
        if buffer.validate():
            if self.handler:
                self.handler(cli, buffer)

            buffer.append_to_history()