Finds the main entry for the given position or Zobrist hash.

        The main entry is the (first) entry with the highest weight.

        By default, entries with weight ``0`` are excluded. This is a common
        way to delete entries from an opening book without compacting it. Pass
        *minimum_weight* ``0`` to select all entries.

        :raises: :exc:`IndexError` if no entries are found. Use
            :func:`~chess.polyglot.MemoryMappedReader.get()` if you prefer to
            get ``None`` instead of an exception.

def find(self, board: Union[chess.Board, int], *, minimum_weight: int = 1, exclude_moves: Container[chess.Move] = ()) -> Entry:
        """
        Finds the main entry for the given position or Zobrist hash.

        The main entry is the (first) entry with the highest weight.

        By default, entries with weight ``0`` are excluded. This is a common
        way to delete entries from an opening book without compacting it. Pass
        *minimum_weight* ``0`` to select all entries.

        :raises: :exc:`IndexError` if no entries are found. Use
            :func:`~chess.polyglot.MemoryMappedReader.get()` if you prefer to
            get ``None`` instead of an exception.
        """
        try:
            return max(self.find_all(board, minimum_weight=minimum_weight, exclude_moves=exclude_moves), key=lambda entry: entry.weight)
        except ValueError:
            raise IndexError()