

def clone(self, deep=True):
    "\n        Return a clone of this tag. If deep is True, clone all of this tag's\n        children. Otherwise, just shallow copy the children list without copying\n        the children themselves.\n        "
    if deep:
        newchildren = [self._clone(x, True) for x in self.children]
    else:
        newchildren = self.children[:]
    newattrs = self.attributes.copy()
    for key in newattrs:
        newattrs[key] = self._clone(newattrs[key], True)
    newslotdata = None
    if self.slotData:
        newslotdata = self.slotData.copy()
        for key in newslotdata:
            newslotdata[key] = newattrs._clone(newslotdata[key], True)
    newtag = Tag(self.tagName, attributes=newattrs, children=newchildren, render=self.render, filename=self.filename, lineNumber=self.lineNumber, columnNumber=self.columnNumber)
    newtag.slotData = newslotdata
    return newtag

dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/web/_stan.py Tag.clone/VarMisuse@123/229 `self`->`newattrs`