from typing import Dict
from typing import Tuple


def _has_all_valid_descriptors(peak_descriptors: Dict[str, float],
                               filters: Dict[str, Tuple[float, float]]) -> bool:
    """
    Check that the descriptors of a peak are in a valid range.

    aux function of get_peak_descriptors.

    Parameters
    ----------
    peak_descriptors : dict
        Dictionary from descriptors names to values.
    filters : dict
        Dictionary from descriptors names to minimum and maximum acceptable
        values.

    Returns
    -------
    is_valid : bool
        True if all descriptors are inside the valid ranges.

    """
    res = True
    for descriptor, (lb, ub) in filters.items():
        d = peak_descriptors[descriptor]
        is_valid = (d >= lb) and (d <= ub)
        if not is_valid:
            res = False
            break
    return res