Check to see if an attribute is defined for the model.
352979
def has_attr(cls, attr_name):
    """"""
    if attr_name in cls.attrs:
      return True

    if isinstance(cls.primary_key_name, str) and cls.primary_key_name == attr_name:
      return True

    if isinstance(cls.primary_key_name, tuple) and attr_name in cls.primary_key_name:
      return True

    if cls.timestamps is not None and attr_name in cls.timestamps:
      return True

    return False
666314
def is_models_name_lookup_attribute(self, base):
        
        return (
            isinstance(base, ast.Attribute) and
            isinstance(base.value, ast.Name) and
            base.value.id == 'models' and base.attr == self.model_name_lookup
        )
105694
def is_attribute?
      info = attr_info
      if info
        read_or_write = name.to_s =~ /=$/ ? :write : :read
        info[read_or_write] ? true : false
      else
        false
      end
    end
200827
def has_model(self, model):
        
        # TODO:
        # - accept DigitalObject for model?
        # - convert model pid to info:fedora/ form if not passed in that way?
        try:
            rels = self.rels_ext.content
        except RequestFailed:
            # if rels-ext can't be retrieved, confirm this object does not have a RELS-EXT
            # (in which case, it does not subscribe to the specified content model)
            if "RELS-EXT" not in self.ds_list.keys():
                return False
            else:
                raise

        st = (self.uriref, modelns.hasModel, URIRef(model))
        return st in rels
604278
function(attributes) {
    if (typeof attributes === 'object' && !Array.isArray(attributes) && attributes !== null) {
      lodashForOwn(attributes, function(value, key) {
        if (typeof value === 'undefined') {
          throw new Error(sprintf(ERROR_MESSAGES.UNDEFINED_ATTRIBUTE, MODULE_NAME, key));
        }
      });
      return true;
    } else {
      throw new Error(sprintf(ERROR_MESSAGES.INVALID_ATTRIBUTES, MODULE_NAME));
    }
  }
147028
function shouldIncludeAllAttributes(attributes) {
  return((typeof(attributes) !== 'undefined') &&
         ((attributes.length === 0) ||
          _.any(attributes || [], function(attribute) {
           return(attribute === '*');
         }))
  );
}
1063488
def has(self, name):
        
        for attr in self.attributes:
            if attr.name == name.strip():
                return True
        return False
766790
def has_attribute(self, attribute: str) -> bool:
        
        return any([
            key_node.value == attribute for key_node, _ in self.yaml_node.value
        ])
1236507
def _hasattr(self, fieldname):
        """"""
        special = 'history', 'raw'
        return (fieldname in special or 
                fieldname in self._defn.fieldmap or
                fieldname in self._defn.derivationmap)
975425
function(attr) {
      if (attr == null) return !_.isEmpty(this.changed);
      return _.has(this.changed, attr);
    }
1083862
def _checkAttribs(self, strict):
        """"""
        if self.choice:
            warning("Choice values not allowed for real-type parameter " +
                    self.name, strict)
            self.choice = None
28082
def _validate_attributes_type(self):
        """"""
        for _attr, _class in self._get_attributes():
            if isinstance(_attr, _class):
                return True
            elif issubclass(_class, GenericType):
                if GenericStruct._attr_fits_into_class(_attr, _class):
                    return True
            elif not isinstance(_attr, _class):
                return False
        return True
226967
function(attr) {
      if (attr == null) return !!Object.keys(this.changed).length;
      return _.has(this.changed, attr);
    }
591982
def is_defined(self, obj, force_import=False):
        """"""
        from spyder_kernels.utils.dochelpers import isdefined

        ns = self._get_current_namespace(with_magics=True)
        return isdefined(obj, force_import=force_import, namespace=ns)
1285574
def inspect
      # We check defined?(@attributes) not to issue warnings if the object is
      # allocated but not initialized.
      inspection = if defined?(@attributes) && @attributes
        self.class.attribute_names.collect do |name|
          if has_attribute?(name)
            attr = _read_attribute(name)
            value = if attr.nil?
              attr.inspect
            else
              attr = format_for_inspect(attr)
              inspection_filter.filter_param(name, attr)
            end
            "#{name}: #{value}"
          end
        end.compact.join(", ")
      else
        "not initialized"
      end

      "#<#{self.class} #{inspection}>"
    end
141893
def data_attributes_exist
      return unless data_attributes
      attr_names = data_class.try(:attribute_names) || []
      unknown_attrs = data_attributes.select do |a|
        (a.class == Symbol || a.class == String) && !attr_names.include?(a.to_s)
      end
      return if unknown_attrs.count == 0

      errors.add(:data_attributes, "must be attributes on the model class " \
                 "(unrecognized: #{unknown_attrs.join(', ')})")
    end
97802
def hasAttribute(self, attrName):
        '''
            
        '''
        attrName = attrName.lower()

        # Check if requested attribute is present on this node
        return bool(attrName in self._attributes)