def _associate_bookmarks_to_pages(self, pages, bookmarks=None):
        if bookmarks == None:
            bookmarks = self.bookmarks

        for b in bookmarks:
            if type(b) == list:
                self._associate_bookmarks_to_pages(pages, b)
                continue
                
            pageno = None
            bp = b['/Page']
            
            if type(bp) == NumberObject:
                continue
                
            for p in pages:
                if bp.getObject() == p.pagedata.getObject():
                    pageno = p.id
            
            if pageno != None:
                b[NameObject('/Page')] = NumberObject(pageno)
            else:
                raise ValueError, (b['/Title'],) % "Unresolved bookmark '%s'"
dataset/ETHPy150Open colemana/PyPDF2/PyPDF2/merger.py/PdfFileMerger._associate_bookmarks_to_pages/swapped operands of `%`