Called if the key_name class attribute is not None.
352980
def validate_key(self, key):
        
        if not key:
            name = self.__class__.__name__
            msg = "%s response missing %s" % (name, self.key_name)
            raise ValidationException(msg, self)
        elif not isinstance(key, str):
            msg = "Response contains invalid %s type" % self.key_name
            raise ValidationException(msg, type(key))
860903
def get_attribute(cls, soup, key, unknown=None):
        
        if key in soup.attrs:
            return soup.get(key)
        return unknown
225492
def has_key(self, key):
        
        if key in self._dict:
            try: 
                self[key]
                return True
            except ValueError:
                return False
            except KeyError:
                return False
        return False
865161
def _check_configuration(self, *attrs):
        
        for attr in attrs:
            if getattr(self, attr, None) is None:
                raise ConfigurationError("{} not configured".format(attr))
1275593
def __checkAttributes(self):
        
        for a in self.__class__.required:
            if not self.attributes.has_key(a):
                raise SchemaError,\
                    'class instance %s, missing required attribute %s'\
                    %(self.__class__, a)
        for a,v in self.attributes.items():
            # attribute #other, ie. not in empty namespace
            if type(v) is dict:
                continue
            
            # predefined prefixes xmlns, xml
            if a in (XMLSchemaComponent.xmlns, XMLNS.XML):
                continue
            
            if (a not in self.__class__.attributes.keys()) and not\
                (self.isAttribute() and self.isReference()):
                raise SchemaError, '%s, unknown attribute(%s,%s)' \
                    %(self.getItemTrace(), a, self.attributes[a])
1026835
def _check_for_python_keywords(self, kwargs):
        """"""

        kwargs_copy = copy.deepcopy(kwargs)
        for key, val in iteritems(kwargs):
            if isinstance(val, dict):
                kwargs_copy[key] = self._check_for_python_keywords(val)
            elif isinstance(val, list):
                kwargs_copy[key] = self._iter_list_for_dicts(val)
            else:
                if key.endswith('_'):
                    strip_key = key.rstrip('_')
                    if keyword.iskeyword(strip_key):
                        kwargs_copy[strip_key] = val
                        kwargs_copy.pop(key)
        return kwargs_copy
948035
def getattr(self, key):
		
		if key in _MethodFactoryMeta[self.classId]:
			""" property exists """
			return self.__dict__[key]
		else:
			""" property does not exist """
			return None
154383
def find_class(name, classes):
    """"""
    name = name.lower()
    cls = next((c for c in classes if c.configuration_key == name), None)
    if cls is None:
        raise ValueError("No class named '%s' could be found" % name)
    return cls
1024679
def is_not_none(entity, prop, name):
    ""
    return is_not_empty(entity, prop, name) and name in entity._data and getattr(entity, name) is not None
1063488
def has(self, name):
        
        for attr in self.attributes:
            if attr.name == name.strip():
                return True
        return False
589992
def convert_key_to_attr_names(cls, original):
    
    attrs = fields(cls)
    updated = {}
    keys_pulled = set()

    for a in attrs:
        key_name = a.metadata.get('key') or a.name
        if key_name in original:
            updated[a.name] = original.get(key_name)
            keys_pulled.add(key_name)

    if getattr(cls, '__related_strict__', False):
        extra = set(original.keys()) - keys_pulled
        if len(extra):
            raise ValueError("Extra keys (strict mode): {}".format(extra))

    return updated
10298
def has_key(cls, *args):
        
        key = args if len(args) > 1 else args[0]
        return key in cls._instances
970736
def __attr_name(self, name):
		
		if name not in self.cookie_attr_value_compliance.keys():
			suggested_name = name.replace('_', '-').lower()
			if suggested_name not in self.cookie_attr_value_compliance.keys():
				raise ValueError('Invalid attribute name is specified')
			name = suggested_name
		return name
121976
def get_attribute_by_repr(self, attribute_repr_name, mapped_class=None,
                              key=None):
        
        attr_map = self.__get_attribute_map(mapped_class, key, 1)
        try:
            return attr_map[attribute_repr_name]
        except KeyError:
            raise AttributeError(attribute_repr_name)
500568
def is_none(node):
    '''
    '''
    if PY2:
        return isinstance(node, ast.Name) and node.id == 'None'
    return isinstance(node, ast.NameConstant) and node.value is None
1312006
def _pv_name_attribute(opts, key, is_name_attribute=true)
        if is_name_attribute
          if opts[key] == nil
            opts[key] = self.instance_variable_get("@name")
          end
        end
      end
208137
def check_key(self, key):
        """"""
        return _check_key(key, allow_unicode_keys=self.allow_unicode_keys,
                          key_prefix=self.key_prefix)