def METHOD_NAME(
    digest: Digest,
    project: Project,
    target_type: ActionTargetType = ActionTargetType.ISSUE_OWNERS,
    target_identifier: int | None = None,
    fallthrough_choice: FallthroughChoiceType | None = None,
) -> Mapping[Event, Mapping[ExternalProviders, set[RpcActor]]]:
    """
    This is probably the slowest part in sending digests because we do a lot of
    DB calls while we iterate over every event. It would be great if we could
    combine some queries.
    """
    return {
        event: get_send_to(
            project=project,
            target_type=target_type,
            target_identifier=target_identifier,
            event=event,
            fallthrough_choice=fallthrough_choice,
        )
        for event in get_event_from_groups_in_digest(digest)
    }