Gets the resource attribute if available

        :param attr: Name of the attribute
        :return: Value of the attribute, if set in the resource. None otherwise
347740
def get_resource_attribute(self, attr):
        
        if attr not in self.resource_attributes:
            raise KeyError("%s is not in resource attributes" % attr)

        return self.resource_attributes[attr]
1267970
def igetattr(self, attrname, context=None):
        
        if attrname == "start":
            yield self._wrap_attribute(self.lower)
        elif attrname == "stop":
            yield self._wrap_attribute(self.upper)
        elif attrname == "step":
            yield self._wrap_attribute(self.step)
        else:
            yield from self.getattr(attrname, context=context)
425117
def model_attr(attr_name):
    

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

    return model_attr
785459
def attr(aid):
    '''
    
    '''
    def _attr(ctx):
        return ctx.current_link[ATTRIBUTES].get(aid)
    return _attr
1297262
public <T> T getAttribute(String attrName, Class<T> clazz) {
        Lock lock = lockForRead();
        try {
            return MapUtils.getValue(attributes, attrName, clazz);
        } finally {
            lock.unlock();
        }
    }
30898
def value_attr(attr_name):
    

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

    return value_attr
253199
def get_attribute(self, name):
        
        assert isinstance(name, basestring)
        value = None
        if self.__attributes and name in self.__attributes.keys():
            value = self.__attributes[name]
        return value
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)
616010
def resource_attribute(resource, name)
      raise ArgumentError, "Attribute name cannot be empty" if name.empty?
      resource_attributes(resource)[name.to_s]
    end
26629
def get_attribute(self, instance):
        
        try:
            return get_attribute(instance, self.source_attrs)
        except (KeyError, AttributeError) as exc:
            if not self.required and self.default is empty:
                raise SkipField()
            msg = (
                'Got {exc_type} when attempting to get a value for field '
                '`{field}` on serializer `{serializer}`.\nThe serializer '
                'field might be named incorrectly and not match '
                'any attribute or key on the `{instance}` instance.\n'
                'Original exception text was: {exc}.'.format(
                    exc_type=type(exc).__name__,
                    field=self.field_name,
                    serializer=self.parent.__class__.__name__,
                    instance=instance.__class__.__name__,
                    exc=exc
                )
            )
            raise type(exc)(msg)
751932
public Object getSessionAttr(final String attrName) {
    final HttpSession sess = request.getSession(false);

    if (sess == null) {
      return null;
    }

    return sess.getAttribute(attrName);
  }
280115
def get_property(self, name):
        
        for prop in self.resource.properties:
            if prop.name == name:
                return prop

        raise AttributeError(name)
422670
def is_resource_class_resource_attribute(rc, attr_name):
    
    attr = get_resource_class_attribute(rc, attr_name)
    return attr != RESOURCE_ATTRIBUTE_KINDS.TERMINAL
564734
def getAttributeNode(self, attr: str) -> Optional[Attr]:
        
        return self.attributes.getNamedItem(attr)
594945
def provide_attr(attr)
      list_item_attr_value = list_item.public_send(attr)

      # Provide user supplied attr
      return list_item_attr_value if list_item_attr_value.present?

      # Provide object supplied attr
      return object_data[attr] if object_available?

      # Provide error - Object is linked but has been deleted
      return 'Object Unavailable' if list_item.object? && !object_available?

      # Provide empty string - no attr supplied and no object linked
      ''
    end
368826
def _make_attr_element_from_resourceattr(parent, resource_attr_i):
    

    attr = _make_attr_element(parent, resource_attr_i.attr)

    attr_is_var    = etree.SubElement(attr, 'is_var')
    attr_is_var.text = resource_attr_i.attr_is_var

    return attr
959264
def get_attr(self):
        
        self.values = getattr(self.attrs, self.kind_attr, None)
        self.dtype = getattr(self.attrs, self.dtype_attr, None)
        self.meta = getattr(self.attrs, self.meta_attr, None)
        self.set_kind()