Takes the attribute value of the given component and returns it

This command operates on the single entity within context.
556200
function commandAttr(context, attributes) {
    let ii, jj, len, jlen, result;
    let entity = context.entity;
    // let debug = context.debug;
    const componentIDs = context.componentIDs;

    // printIns( context,1 );
    // if( debug ){ console.log('ATTR> ' + stringify(componentIDs) + ' ' + stringify( _.rest(arguments))  ); }

    // if( !componentIDs ){
    //     throw new Error('no componentIDs in context');
    // }

    if (!entity) {
        // console.log('ATTR> no entity');
        return (context.last = [VALUE, null]);
    }

    attributes = Array.isArray(attributes) ? attributes : [attributes];
    // components = entity.components;
    result = [];

    const components = entity.getComponents(componentIDs);

    // console.log('commandComponentAttribute', attributes);
    for (ii = 0, len = components.length; ii < len; ii++) {
        const component = components[ii];
        for (jj = 0, jlen = attributes.length; jj < jlen; jj++) {
            const attr = attributes[jj];
            const val = component.get(attr);
            if (val !== undefined) {
                result.push(val);
            }
        }
    }

    if (result.length === 0) {
        result = null;
    } else if (result.length === 1) {
        result = result[0];
    }

    return (context.last = [VALUE, result]);
}
469246
public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue)
    {
        final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);

        if (attrNode == null)
        {
            return defValue;
        }

        return attrNode.getNodeValue();
    }
1001804
def get_attribute(self, obj, attribute):
        
        raw_return = self.send_command_return(obj, attribute, '?')
        if len(raw_return) > 2 and raw_return[0] == '"' and raw_return[-1] == '"':
            return raw_return[1:-1]
        return raw_return
1025661
def GetSchema(component):
    
    parent = component
    while not isinstance(parent, XMLSchema):
        parent = parent._parent()
    return parent
74824
@SuppressWarnings("unchecked")
    public static <T> Optional<T> getAnnotationAttribute(final Annotation anno, final String attrName, final Class<T> attrType) {
        
        try {
            final Method method = anno.annotationType().getMethod(attrName);
            method.setAccessible(true);
            if(!attrType.equals(method.getReturnType())) {
                return Optional.empty();
            }
            
            final Object value = method.invoke(anno);
            return Optional.of((T)value);
            
        } catch (Exception e) {
            return Optional.empty();
        }
        
    }
784257
public Integer getIntObject(String attributeName) {
        String val = get(attributeName, null);
        if (val != null) {
            return Integer.valueOf(val);
        }
        return null;
    }
160635
private Object getColumnValue(EntityMetadata m, Object e, Attribute attribute)
    {
        Field field = (Field) ((Attribute) attribute).getJavaMember();
        Object value;
        if (!m.isCounterColumnType())
        {
            value = getThriftColumnValue(e, attribute);
        }
        else
        {
            value = PropertyAccessorHelper.getString(e, field);
        }
        return value;
    }
63511
public Referenceable getEntity(final String entityType, final String attribute, final String value)
            throws AtlasServiceException {
        JSONObject jsonResponse = callAPIWithRetries(API.GET_ENTITY, null, new ResourceCreator() {
            @Override
            public WebResource createResource() {
                WebResource resource = getResource(API.GET_ENTITY);
                resource = resource.queryParam(TYPE, entityType);
                resource = resource.queryParam(ATTRIBUTE_NAME, attribute);
                resource = resource.queryParam(ATTRIBUTE_VALUE, value);
                return resource;
            }
        });
        try {
            String entityInstanceDefinition = jsonResponse.getString(AtlasClient.DEFINITION);
            return InstanceSerialization.fromJsonReferenceable(entityInstanceDefinition, true);
        } catch (JSONException e) {
            throw new AtlasServiceException(API.GET_ENTITY, e);
        }
    }
137473
private String getAttribute(BeanDefinition beanDefinition, String attributeName) {
        String value = null;
        
        while (beanDefinition != null) {
            value = (String) beanDefinition.getAttribute(attributeName);
            
            if (value != null) {
                break;
            }
            
            beanDefinition = beanDefinition.getOriginatingBeanDefinition();
        }
        
        return value;
    }
774863
def get_attribute(self):
        """"""
        attributes = ['dependencies', 'publics', 'members', 
                          'types', 'executables']
        #Find the correct attribute based on the type of the context
        if self.context.el_type in [Function, Subroutine]:
            attribute = attributes[4]
        elif self.context.el_type == CustomType:
            attribute = attributes[3]
        else:
            attribute = attributes[2]

        return attribute
28705
@Pure
	protected AttributeValue getStoredAttributeValue(String name, AttributeType expectedType) {
		Object val = this.heap.get(name);
		if (val != null) {
			final AttributeType currentType = AttributeType.fromValue(val);
			val = unprotectNull(val);
			final AttributeValue attr = new AttributeValueImpl(name);
			if (expectedType == null) {
				attr.castAndSet(currentType, val);
			} else {
				attr.castAndSet(expectedType, val);
			}
			return attr;
		}
		return null;
	}
14204
def _get_value(self, entity):
    """"""
    value = self._get_user_value(entity)
    if value is None and entity._projection:
      # Invoke super _get_value() to raise the proper exception.
      return super(StructuredProperty, self)._get_value(entity)
    return value
277068
public Object getAttribute(String attributeName) {

        if (m_attributeMap == null) {
            return null;
        }
        return m_attributeMap.get(attributeName);
    }
802744
private static Object extractAttributeValueIfAttributeQueryConstant(InternalSerializationService serializationService,
                                                                        String attributeName, Data key, Object value) {
        if (KEY_ATTRIBUTE_NAME.value().equals(attributeName)) {
            return serializationService.toObject(key);
        } else if (THIS_ATTRIBUTE_NAME.value().equals(attributeName)) {
            return value instanceof Data ? serializationService.toObject(value) : value;
        }
        return null;
    }
55457
public Object getAttribute(String key, Object defaultValue)
    {
        Object attributeValue = getUserAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        attributeValue = getSessionAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        return defaultValue;
    }
752033
public function getValueData(AttributeInterface $attribute, array $context = null)
    {
        $valuesData = $this->getValuesData($attribute, $context);

        return 0 === \count($valuesData) ? null : $valuesData->first();
    }
347188
@Override
  public Object getValue(ELContext context, Object base, Object property) {
    return getValue(context, base, property, true);
  }