def _expand_total_pairs(total_pairs):
    """Expands total_pairs so that it has one key per direction.
    e.g., 'breitbart-foxnews' and 'foxnews-breitbart' exist as keys.

    If expansion is skipped, then total_pairs only has one key per pair of (unordered) elements.
    e.g., 'breitbart-foxnews' exists as a key but 'foxnews-breitbart' does not.

    The total per element-pair is the same value for both directions.
    e.g., 'breitbart-foxnews' and 'foxnews-breitbart' are assigned the same total count.

    """

    total_pairs_expanded = {}
    for k, v in total_pairs.items():
        total_pairs_expanded[(k[0], k[1])] = v
        total_pairs_expanded[(k[1], k[0])] = v
    total_pairs_expanded = dict(sorted(total_pairs_expanded.items()))

    return total_pairs_expanded