'Finds books that have a superset of the authors in mi and the same
title (title is fuzzy matched). See also :meth:`data_for_find_identical_books`.'

@read_api
def find_identical_books(self, mi, search_restriction=u'', book_ids=None):

    from calibre.db.utils import fuzzy_title
    identical_book_ids = set()
    if mi.authors:
        try:
            quathors = mi.authors[:20]
            query = u'    and    '.join(((u'authors:"=%s"' % a.replace(u'"', u'')) for a in quathors))
            qauthors = mi.authors[20:]
        except ValueError:
            return identical_book_ids
        try:
            book_ids = self._search(query, restriction=search_restriction, book_ids=book_ids)
        except:
            traceback.print_exc()
            return identical_book_ids
        if (qauthors and book_ids):
            matches = set()
            qauthors = {icu_lower(x) for x in qauthors}
            for book_id in book_ids:
                aut = self._field_for(u'authors', book_id)
                if aut:
                    aut = {icu_lower(x) for x in aut}
                    if aut.issuperset(qauthors):
                        matches.add(book_id)
            book_ids = matches
        for book_id in book_ids:
            fbook_title = self._field_for(u'title', book_id)
            fbook_title = fuzzy_title(fbook_title)
            mbook_title = fuzzy_title(mi.title)
            if (fbook_title == mbook_title):
                identical_book_ids.add(book_id)
    return identical_book_ids
