code: def setparents(self):
          
          for c in self:
              if isinstance(c, AbstractElement):
                  c.parent = self
                  c.setparents()
docs: Correct all parent relations for elements within the scop. There is sually no need to call this directly, invoked implicitly by :meth:`copy`