from typing import Callable
from typing import Iterable


def matching_indices(rule: Callable, series: Iterable) -> Iterable[int]:
    """
    Return the indicies of matching records.
    """
    return [i for i, item in enumerate(series) if rule(item)]