from typing import Tuple
from typing import Dict


def load_data() -> Tuple[Dict, Dict]:
    """
    Helper function which loads female and male data from the `data` folder
    :return:
        Two dictionaries (female and male) where the key is the region and the value is
        a list of the most common names
    """

    female_dict, male_dict = dict(), dict()

    for dfile, g_dict in zip(
            ['data/female.txt', 'data/male.txt'],
            [female_dict, male_dict]):

        with open(dfile, 'r') as fh:

            for line in fh:
                splits = line.split()
                country = splits[0]
                g_dict[country] = set(splits[1:])

    return female_dict, male_dict