def local_attr_ancestors(self, name, context=None):
<EOL>try:<EOL><INDENT>ancestors = self.mro(context)[<NUM_LIT:1>:]<EOL><DEDENT>except exceptions.MroError:<EOL><INDENT>ancestors = self.ancestors(context=context)<EOL><DEDENT>for astroid in ancestors:<EOL><INDENT>if name in astroid:<EOL><INDENT>yield astroid<EOL><DEDENT><DEDENT>
Iterate over the parents that define the given name.

        :param name: The name to find definitions for.
        :type name: str

        :returns: The parents that define the given name.
        :rtype: iterable(NodeNG)