def addBookmark(self, title, pagenum, parent=None):
        """
        Add a bookmark to the pdf, using the specified title and pointing at 
        the specified page number. A parent can be specified to make this a
        nested bookmark below the parent.
        """

        if parent == None:
        	iloc = [1-len(self.bookmarks)]
        elif type(parent) == list:
        	iloc = parent
        else:
        	iloc = self.findBookmark(parent)
        
        dest = Bookmark(TextStringObject(title), NumberObject(pagenum), NameObject('/FitH'), NumberObject(826))
        
        if parent == None:
        	self.bookmarks.append(dest)
        else:
        	bmparent = self.bookmarks
        	for i in iloc[:-1]:
        		bmparent = bmparent[i]
        	npos = iloc[-1]+1
        	if npos < len(bmparent) and type(bmparent[npos]) == list:
        		bmparent[npos].append(dest)
        	else:
        		bmparent.insert(npos, [dest])
dataset/ETHPy150Open colemana/PyPDF2/PyPDF2/merger.py/PdfFileMerger.addBookmark/swapped operands of `-`