Returns an attribute of the resource.

@param  mixed  $attribute
@param  mixed  $default
@return mixed
164767
public function get($attribute = null, $default = null)
    {
        if (is_null($attribute)) {
            return $this->attributes;
        }

        if (array_key_exists($attribute, $this->attributes)) {
            return $this->attributes[$attribute];
        }

        return $default;
    }
240724
public function attr($attribute)
    {
        if (!$this->attributes instanceof EntityAttributeContainer) {
            $this->attributes = $this->createEntityAttributeContainer();
        }

        return $this->attributes->attr($attribute);
    }
1361001
def get(self, attr, default=None):
        """"""

        attrs = self.body.get('attributes') or {}
        return attrs.get(attr, default)
985538
public function getSessionAttribute($key, $default = false) {
		return isset($this->sessionAttributes[$key]) ? $this->sessionAttributes[$key] : $default;
	}
632411
public function getDbAttribute($attribute, $default = null)
    {
        return isset($this->_dbAttributes[$attribute]) ? $this->_dbAttributes[$attribute] : $default;
    }
571960
public function getInfo($attribute = null)
    {
        if (!isset($this->sourceAttributes)) {
            $this->sourceAttributes = $this->getSourceAttributes();
        }

        if (!is_null($attribute)) {
            return isset($this->sourceAttributes[$attribute]) ? $this->sourceAttributes[$attribute] : null;
        }

        return $this->sourceAttributes;
    }
133424
public function attr($attribute = null)
    {
        if ($this->isNull($attribute)) {
            return $this->attribute;
        }

        return $this->parent->attr($attribute);
    }
1304880
public function attr($attribute)
    {
        $node = $this->getNode();
        $value = null;

        if ($node instanceof \DOMNode) {
            $value = $node->getAttribute($attribute);
        } else {
            foreach ($node as $item) {
                if ($item->hasAttribute($attribute)) {
                    $value = $node->attr($attribute);
                }

                break;
            }
        }

        return $value;
    }
732926
public function getAttribute($name, $default = null)
	{
		if ($this->element instanceof SimpleXMLElement)
		{
			$attributes = $this->element->attributes();

			// Ensure that the attribute exists
			if (property_exists($attributes, $name))
			{
				$value = $attributes->$name;

				if ($value !== null)
				{
					return (string) $value;
				}
			}
		}

		return $default;
	}
1047031
protected function getAttribute($attribute)
	{
		// The developer may dynamically specify the array of custom attributes
		// on this Validator instance. If the attribute exists in this array
		// it takes precedence over all other ways we can pull attributes.
		if (isset($this->customAttributes[$attribute]))
		{
			return $this->customAttributes[$attribute];
		}

		$key = "validation.attributes.{$attribute}";

		// We allow for the developer to specify language lines for each of the
		// attributes allowing for more displayable counterparts of each of
		// the attributes. This provides the ability for simple formats.
		if (($line = $this->translator->trans($key)) !== $key)
		{
			return $line;
		}

		// If no language line has been specified for the attribute all of the
		// underscores are removed from the attribute name and that will be
		// used as default versions of the attribute's displayable names.
		return str_replace('_', ' ', snake_case($attribute));
	}
674920
public function attr($key, $default = null)
    {
        if(isset($this->attributes[$key]))
            return $this->attributes[$key];

        return $this->finding->getAttribute($key, $default);
    }
178518
public function getAttribute($field, $name, $default = null, $group = null)
    {
        $field = $this->getField($field, $group);

        if ($field) {
            return $field->getAttribute($name, $default);
        }

        return $default;
    }
297999
public function getAttribute($attribute)
    {
        if (! isset($this->attributes[$attribute])) {
            throw new \Exception('Attribute "'.$attribute.'" is not set');
        }
        $this->attributes[$attribute];
    }
1163461
public function attr($attribute, $value = null)
    {
        if (is_array($attribute)) return $this->attributes($attribute);
        if ($value) return $this->attributes(array($attribute => $value));
    }
71078
public function getAttribute($name, $default = null)
    {
        if (empty($this->attribs[$name])) {
            return $default;
        }

        return $this->attribs[$name];
    }
1356098
protected function _getQuestionAttribute($qid, $attribute, $default = null)
    {
        if (! is_array($this->_attributes)) {
            $this->_attributes = [];            
            $attributesTable  = $this->_getQuestionAttributesTableName();
            $questionsTable   = $this->_getQuestionsTableName();
            $surveyTable      = $this->_getSurveysTableName();

            $sql = 'SELECT a.qid, a.attribute, a.value FROM ' . $attributesTable . ' AS a
                LEFT JOIN ' . $questionsTable . ' AS q ON q.qid = a.qid
                LEFT JOIN ' . $surveyTable . ' AS s ON s.sid = q.sid AND q.language = s.language
                WHERE s.sid = ?';

            $attributes = $this->lsDb->fetchAll($sql, $this->sourceSurveyId);
            
            if (false === $attributes) {
                // If DB lookup failed, return the default
                return $default;
            }
            
            foreach ($attributes as $attrib) {
                $this->_attributes[$attrib['qid']][$attrib['attribute']] = $attrib['value'];
            }
        }

        if (isset($this->_attributes[$qid][$attribute]) && strlen(trim($this->_attributes[$qid][$attribute]))) {
            return $this->_attributes[$qid][$attribute];
        } else {
            return $default;
        }
    }
1308304
public function get($key, $default = null)
    {
        if (array_key_exists($key, $this->attributes)) {
            return $this->attributes[$key];
        }

        return $default;
    }