def first_matching(iterable, predicate):
    """The first item matching a predicate.

    Args:
        iterable: An iterable series of items to be searched.
        predicate: A callable to which each item will be passed in turn.

    Returns:
        The first item for which the predicate returns True.

    Raises:
        ValueError: If there are no matching items.
    """
    for item in iterable:
        if predicate(item):
            return item
    raise ValueError("No matching items")