def getattr(self, name, context=None, class_context=True):
values = self.locals.get(name, [])<EOL>if name in self.special_attributes and class_context and not values:<EOL><INDENT>result = [self.special_attributes.lookup(name)]<EOL>if name == "<STR_LIT>":<EOL><INDENT>result += values<EOL><DEDENT>return result<EOL><DEDENT>values = list(values)<EOL>for classnode in self.ancestors(recurs=True, context=context):<EOL><INDENT>values += classnode.locals.get(name, [])<EOL><DEDENT>if class_context:<EOL><INDENT>values += self._metaclass_lookup_attribute(name, context)<EOL><DEDENT>if not values:<EOL><INDENT>raise exceptions.AttributeInferenceError(<EOL>target=self, attribute=name, context=context<EOL>)<EOL><DEDENT>for value in values:<EOL><INDENT>if isinstance(value, node_classes.AssignName):<EOL><INDENT>stmt = value.statement()<EOL>if isinstance(stmt, node_classes.AnnAssign) and stmt.value is None:<EOL><INDENT>raise exceptions.AttributeInferenceError(<EOL>target=self, attribute=name, context=context<EOL>)<EOL><DEDENT><DEDENT><DEDENT>return values<EOL>
Get an attribute from this class, using Python's attribute semantic.

        This method doesn't look in the :attr:`instance_attrs` dictionary
        since it is done by an :class:`Instance` proxy at inference time.
        It may return an :class:`Uninferable` object if
        the attribute has not been
        found, but a ``__getattr__`` or ``__getattribute__`` method is defined.
        If ``class_context`` is given, then it is considered that the
        attribute is accessed from a class context,
        e.g. ClassDef.attribute, otherwise it might have been accessed
        from an instance as well. If ``class_context`` is used in that
        case, then a lookup in the implicit metaclass and the explicit
        metaclass will be done.

        :param name: The attribute to look for.
        :type name: str

        :param class_context: Whether the attribute can be accessed statically.
        :type class_context: bool

        :returns: The attribute.
        :rtype: list(NodeNG)

        :raises AttributeInferenceError: If the attribute cannot be inferred.