def _run_feedback_on_inputs(
    flattened_inputs: List[
        Tuple[str, Optional[str], Dict[str, FeedbackFunctionInput]]
    ],
    feedback_name: str,
    feedback_function: Callable[
        [Any], Union[float, Tuple[float, Dict[str, Any]]]
    ],
    higher_is_better: bool,
    feedback_aggregator: Optional[Callable[[List[float]], float]],
    record_id_to_record_root: Dict[str, pd.Series],
) -> int:
    """Run feedback function on all inputs.

    Args:
        flattened_inputs: Flattened inputs. Each entry is a tuple of (record_id, span_group, inputs).
        feedback_name: Name of the feedback function.
        feedback_function: Function to compute feedback.
        higher_is_better: Whether higher values are better.
        feedback_aggregator: Aggregator function to combine feedback scores.
        record_id_to_record_root: Mapping from record_id to record root.

    Returns:
        Number of feedbacks computed.
    """
    ret = 0
    for record_id, span_group, inputs in flattened_inputs:
        try:
            _call_feedback_function(
                feedback_name,
                feedback_function,
                higher_is_better,
                feedback_aggregator,
                inputs,
                record_id_to_record_root[record_id]["record_attributes"],
                record_id_to_record_root[record_id]["resource_attributes"],
                span_group,
            )
            ret += 1
        except Exception as e:
            _logger.warning(
                f"feedback_name={feedback_name}, record={record_id}, span_group={span_group} had an error during computation:\n{str(e)}"
            )
    return ret
Run feedback function on all inputs.

    Args:
        flattened_inputs: Flattened inputs. Each entry is a tuple of (record_id, span_group, inputs).
        feedback_name: Name of the feedback function.
        feedback_function: Function to compute feedback.
        higher_is_better: Whether higher values are better.
        feedback_aggregator: Aggregator function to combine feedback scores.
        record_id_to_record_root: Mapping from record_id to record root.

    Returns:
        Number of feedbacks computed.
    
src/feedback/trulens/feedback/computer.py