def local_attr(self, name, context=None):
result = []<EOL>if name in self.locals:<EOL><INDENT>result = self.locals[name]<EOL><DEDENT>else:<EOL><INDENT>class_node = next(self.local_attr_ancestors(name, context), None)<EOL>if class_node:<EOL><INDENT>result = class_node.locals[name]<EOL><DEDENT><DEDENT>result = [n for n in result if not isinstance(n, node_classes.DelAttr)]<EOL>if result:<EOL><INDENT>return result<EOL><DEDENT>raise exceptions.AttributeInferenceError(<EOL>target=self, attribute=name, context=context<EOL>)<EOL>
Get the list of assign nodes associated to the given name.

        Assignments are looked for in both this class and in parents.

        :returns: The list of assignments to the given name.
        :rtype: list(NodeNG)

        :raises AttributeInferenceError: If no attribute with this name
            can be found in this class or parent classes.