code: def local_attr_ancestors(self, name, context=None):
          
          # Look up in the mro if we can. This will result in the
          # attribute being looked up just as Python does it.
          try:
              ancestors = self.mro(context)[1:]
          except exceptions.MroError:
              # Fallback to use ancestors, we can't determine
              # a sane MRO.
              ancestors = self.ancestors(context=context)
          for astroid in ancestors:
              if name in astroid:
                  yield astroid
docs: 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)