def selected_data(accu, selector):
    """
    Returns the selected data.
    If the selector function is not None, returns the results of
    applying the selector function to accu.
    Otherwise returns accu.
    :param accu: The data accumulator
    :param selector: Optional iterable returning function that has the items to be saved
    :return:
    """
    if selector is None:
        return accu
    return selector(accu)