from typing import Dict
from typing import Tuple


def expectation_from_counts(counts: Dict[Tuple[int, ...], int]) -> float:
    """Estimates the expectation value of a circuit from shot counts.
    Computes the parity of '1's across all bits to determine a +1 or -1 contribution
    from each readout, and returns the weighted average.

    :param counts: Counts of each measurement outcome observed.
    :type counts: Dict[Tuple[int, ...], int]
    :return: The expectation value in the range [-1, 1].
    :rtype: float
    """
    aritysum = 0.0
    total_shots = 0
    for row, count in counts.items():
        aritysum += count * (sum(row) % 2)
        total_shots += count
    return -2 * aritysum / total_shots + 1