Check cookie attribute value for validity. Return True if value is valid

		:param attr_name: attribute name to check
		:param attr_value: attribute value to check
		:return: bool
973457
def cookie_attr_value_check(attr_name, attr_value):
		
		attr_value.encode('us-ascii')
		return WHTTPCookie.cookie_attr_value_compliance[attr_name].match(attr_value) is not None
1307754
def safe_setattr(obj, name, value):
    """"""
    try:
        setattr(obj, name, value)
        return True
    except AttributeError:
        return False
1009066
protected function _validate($name, $attrName)
    {
        if( ! empty($this->validate) )
        {
            $validate[$name]           = $this->validate;
            $validate[$name]['value']  = $this->settings['attr']['alias'] ?? $attrName;

            $session = Singleton::class('ZN\Storage\Session');

            $session->insert('FormValidationMethod', $this->method);
            $session->insert('FormValidationRules' , array_merge($session->select('FormValidationRules') ?: $validate, $validate));
 
            $this->validate = [];
        }
    }
30898
def value_attr(attr_name):
    

    def value_attr(value, context, **_params):
        value = getattr(value, attr_name)
        return _attr(value)

    return value_attr
1080316
def source_attr(attr_name):
    

    def source_attr(value, context, **_params):
        setattr(context["model"].source, attr_name, value)
        return _attr()

    return source_attr
698155
def validate(self, value):
        
        if value is None:
            return
        if len(self.classes) and not isinstance(value, self.classes):
            msg = '"%s" must be: %s' % (self.name, self.classes)
            raise AttributeError(msg)
480245
def is_attr_selected(attr_name,     # type: str
                     include=None,  # type: Union[str, Tuple[str]]
                     exclude=None   # type: Union[str, Tuple[str]]
                     ):
    """"""

    if include is not None and exclude is not None:
        raise ValueError('Only one of \'include\' or \'exclude\' argument should be provided.')

    # win time by not doing this
    # check_var(include, var_name='include', var_types=[str, tuple], enforce_not_none=False)
    # check_var(exclude, var_name='exclude', var_types=[str, tuple], enforce_not_none=False)

    if attr_name is 'self':
        return False
    if exclude and attr_name in exclude:
        return False
    if not include or attr_name in include:
        return True
    else:
        return False
1336363
function isJSXAttributeOfName(attr, name) {
  return t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name, { name: name });
}
488300
def hasattr(self, attr, ns=None):
        
        if not self.__attributes:
            self.setAttributeDictionary()
        if ns:
            return self.__attributes.get(ns,{}).has_key(attr)
        return self.__attributes.has_key(attr)
334973
def attribute_present?(name)
      attribute = read_raw_attribute(name)
      !attribute.blank? || attribute == false
    rescue ActiveModel::MissingAttributeError
      false
    end
1166729
def get_bool_attr(self, name):
    
    val = self.get_attr(name)
    return val is not None and val.lower() in ("true", name)
224380
def validate_attr_name(name):
    

    try:
        validate_sqlite_attr_name(name)
    except (InvalidCharError, InvalidReservedNameError) as e:
        raise NameValidationError(e)
    except NullNameError:
        raise NameValidationError("attribute name is empty")
626334
def ensure_context_attribute_exists(context, name, default_value=None):
    
    if not hasattr(context, name):
        setattr(context, name, default_value)
30982
def validate(self, attrs):
        
        user = authenticate(**self.user_credentials(attrs))

        if user:
            if user.is_active:
                self.instance = user
            else:
                raise serializers.ValidationError(_("This account is currently inactive."))
        else:
            error = _("Invalid login credentials.")
            raise serializers.ValidationError(error)
        return attrs
496869
def valid_attribute?(attribute)
    case attr_type_for(attribute)
    when :bool
      validate_class_for(attribute, [TrueClass, FalseClass])
    when :datetime, :datetimecombo
      validate_class_for(attribute, [DateTime])
    when :int
      validate_class_for(attribute, [Fixnum, Float])
    else 
      if @attributes[attribute].blank?
        add_error(attribute, "cannot be blank")
      end
    end
  end
884523
def restore_attr(self, attr_name):
        
        original_attr = self._original_attr(attr_name)
        if self._original_attr(attr_name):
            setattr(self.obj.__class__, attr_name, original_attr)
24455
def cookie_name_check(cookie_name):
		
		cookie_match = WHTTPCookie.cookie_name_non_compliance_re.match(cookie_name.encode('us-ascii'))
		return len(cookie_name) > 0 and cookie_match is None