<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def probe_dtm(self, board: chess.Board) -> int: """ Probes for depth to mate information. The absolute value is the number of half-moves until forced mate (or ``0`` in drawn positions). The value is positive if the side to move is winning, otherwise it is negative. In the example position white to move will get mated in 10 half-moves: -10 :raises: :exc:`KeyError` (or specifically :exc:`chess.gaviota.MissingTableError`) if the probe fails. Use :func:`~chess.gaviota.PythonTablebase.get_dtm()` if you prefer to get ``None`` instead of an exception. Note that probing a corrupted table file is undefined behavior. """

        # Can not probe positions with castling rights.
        if board.castling_rights:
            raise KeyError("gaviota tables do not contain positions with castling rights: {}".format(board.fen()))

        # Supports only up to 5 pieces.
        if chess.popcount(board.occupied) > 5:
            raise KeyError("gaviota tables support up to 5 pieces, not {}: {}".format(chess.popcount(board.occupied), board.fen()))

        # KvK is a draw.
        if board.occupied == board.kings:
            return 0

        # Prepare the tablebase request.
        white_squares = list(chess.SquareSet(board.occupied_co[chess.WHITE]))
        white_types = [typing.cast(chess.PieceType, board.piece_type_at(sq)) for sq in white_squares]
        black_squares = list(chess.SquareSet(board.occupied_co[chess.BLACK]))
        black_types = [typing.cast(chess.PieceType, board.piece_type_at(sq)) for sq in black_squares]
        side = 0 if (board.turn == chess.WHITE) else 1
        epsq = board.ep_square if board.ep_square else NOSQUARE
        req = Request(white_squares, white_types, black_squares, black_types, side, epsq)

        # Probe.
        dtm = self.egtb_get_dtm(req)
        ply, res = unpackdist(dtm)

        if res == iWMATE:
            # White mates in the stored position.
            if req.realside == 1:
                if req.is_reversed:
                    return ply
                else:
                    return -ply
            else:
                if req.is_reversed:
                    return -ply
                else:
                    return ply
        elif res == iBMATE:
            # Black mates in the stored position.
            if req.realside == 0:
                if req.is_reversed:
                    return ply
                else:
                    return -ply
            else:
                if req.is_reversed:
                    return -ply
                else:
                    return ply
        else:
            # Draw.
            return 0