def clone(self, deep=True):
        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] = self._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
Checks for one more item than last on this page.
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/web/_stan.py/Tag.clone--crossover with--dataset/ETHPy150Open amarandon/smeuhsocial/apps/pagination/paginator.py/InfinitePage.has_next