Returns value of item's attribute
345062
def value_for(item, option)
      attribute = @options[option]
      if attribute.is_a? Proc
        attribute.call(item)
      else
        eval("item.#{attribute}")
      end
    end
60495
def OnGetItemAttr(self, item):
        """"""
        if self.indicated > -1 and item == self.indicated:
            return self.indicated_attribute
        return None
636301
def _get(self, item):
        
        if item not in object.__getattribute__(self, "_protectedItems") \
                and item[0] != "_":
            data = object.__getattribute__(self, "_data")
            if item in data:
                return data[item]
        return object.__getattribute__(self, item)
641784
def get_value(self, node):
        """"""
        if not isinstance(node, ast.Attribute):
            raise TypeError("must be an attribute")

        if node.value.id != self.choices.__name__:
            raise TypeError("must be an attribute of {}".format(self.choices.__name__))

        return getattr(self.choices, node.attr)
397251
def getattr(self, obj, attribute):
        
        try:
            return getattr(obj, attribute)
        except AttributeError:
            pass
        try:
            return obj[attribute]
        except (TypeError, LookupError, AttributeError):
            return self.undefined(obj=obj, name=attribute)
25220
def value(self):
        """"""
        module = __import__(self.module, fromlist=self.module.split('.'))
        if self.name is None:
            return module
        return getattr(module, self.name)
1192389
def getattribute(model, item):
    
    elements = item.split('.')
    element = elements.pop(0)
    try:
        attr = getattr(model, element, None)
    except:
        return
    if attr is None:  # end of recursion
        return
    if callable(attr):
        try:
            attr = attr()
        except:  # couldn't call this method without params
            return
    if elements:
        return getattribute(attr, '.'.join(elements))
    return attr
984923
def get_item_key(self, item):
        """"""
        try:
            ret = item[item['key']]
        except KeyError:
            logger.error("No 'key' available in {}".format(item))
        if isinstance(ret, list):
            return ret[0]
        else:
            return ret
1057336
def get_attr(obj, string_rep, default=_get_attr_raise_on_attribute_error, separator="."):
    
    attribute_chain = string_rep.split(separator)

    current_obj = obj

    for attr in attribute_chain:
        try:
            current_obj = getattr(current_obj, attr)
        except AttributeError:
            if default is _get_attr_raise_on_attribute_error:
                raise AttributeError(
                    "Bad attribute \"{}\" in chain: \"{}\"".format(attr, string_rep)
                )
            return default

    return current_obj
1211449
def getitem(self, obj, argument):
        """"""
        try:
            return obj[argument]
        except (TypeError, LookupError):
            if isinstance(argument, basestring):
                try:
                    attr = str(argument)
                except:
                    pass
                else:
                    try:
                        value = getattr(obj, attr)
                    except AttributeError:
                        pass
                    else:
                        if self.is_safe_attribute(obj, argument, value):
                            return value
                        return self.unsafe_undefined(obj, argument)
        return self.undefined(obj=obj, name=argument)
706379
function getItemAsNameVal (item) {
    if (!item) {
      return undefined;
    }

    var locals = {};
    if (ctrl.itemName) {
      locals[ ctrl.itemName ] = item;
    }

    return locals;
  }
626997
function findElementAttributeValue(attributeName, elems) {

    elems = Array.isArray(elems) ? elems : [ elems ];

    var value = elems.filter(function (elem) {
        return elem.attrib.name.toLowerCase() === attributeName.toLowerCase();
    }).map(function (filteredElems) {
        return filteredElems.attrib.value;
    }).pop();

    return value ? value : '';
}
929141
def get(self, name):
        
        # read the attribute
        attr = getattr(self.context, name, None)
        if callable(attr):
            return attr()
        return attr
632695
def item_attribute(self, f=None, name=None):
        
        def decorator(func):
            attr_name = name or func.__name__
            if attr_name.startswith('_'):
                raise RuntimeError('Invalid dynamic item attribute name -- should not start with an underscore')
            self.__item_attributes[attr_name] = func
            return func

        if f is None:
            return decorator
        else:
            return decorator(f)
361625
function getAttribute(node, attrName) {
	attrName = attrName.toLowerCase();
	return node && node.open.attributes.find(attr => attr.name.value.toLowerCase() === attrName);
}
1286848
def _getitem(self, key):
		""""""
		loc = self._bisect_right(key) - 1
		value = self._values[loc]
		if value is NOT_SET:
			raise KeyError(key)
		else:
			return value
245498
def get(self, item, default=None):
        
        if hasattr(self, item):
            return getattr(self, item)
        try:
            return self.__getitem__(item)

        except KeyError:
            return default