import math
import statistics


def _get_average_da(streams_da: dict) -> dict:
    """Calculate average data availability among all data streams"""
    total_results = {}
    for k, v in streams_da.items():
        for i, j in v.items():
            if i not in total_results:
                total_results[i] = []
            total_results[i].append(j)

    return {k: math.ceil(statistics.mean(v)) for k, v in total_results.items()}