# Path: pacman_mirrors/functions/httpFn.py
# def download_mirrors(config):
# def get_geoip_country():
# def get_mirror_response(url, maxwait=2, count=1, quiet=False, ssl_verify=True):
# def inet_conn_check(maxwait=2):
# def ping_host(host, count=1):
# def update_mirror_pool(config, quiet=False):
# 
# Path: pacman_mirrors/functions/validFn.py
# def custom_config_is_valid():
# def country_list_is_valid(onlycountry, countrylist):


from pacman_mirrors.functions import httpFn
from pacman_mirrors.functions import validFn
    """
    Don't change this code
    This works so please don't touch
    """
    result = []
    if country_selection:
        if country_selection == ["all"]:
            result = country_pool
        else:
            if validFn.country_list_is_valid(country_selection,
                                             country_pool):
                result = country_selection
    if not result:
        if geoip:
            country = get_geoip_country(country_pool)
            if country:  # valid geoip
                result = country
            else:
                result = country_pool
        else:
            result = country_pool
    return result


def get_geoip_country(country_pool):
    """
    Check if geoip is possible
    :param country_pool:
    :return: country name if found
    """

# Path: pacman_mirrors/functions/httpFn.py
# def download_mirrors(config):
# def get_geoip_country():
# def get_mirror_response(url, maxwait=2, count=1, quiet=False, ssl_verify=True):
# def inet_conn_check(maxwait=2):
# def ping_host(host, count=1):
# def update_mirror_pool(config, quiet=False):
# 
# Path: pacman_mirrors/functions/validFn.py
# def custom_config_is_valid():
# def country_list_is_valid(onlycountry, countrylist):


# Path: pacman_mirrors/functions/countryFn.py
from pacman_mirrors.functions import httpFn
from pacman_mirrors.functions import validFn

    """
    Don't change this code
    This works so please don't touch
    """
    result = []
    if country_selection:
        if country_selection == ["all"]:
            result = country_pool
        else:
            if validFn.country_list_is_valid(country_selection,
                                             country_pool):
                result = country_selection
    if not result:
        if geoip:
            country = get_geoip_country(country_pool)
            if country:  # valid geoip
                result = country
            else:
                result = country_pool
        else:
            result = country_pool
    return result


def get_geoip_country(country_pool):
    """
    Check if geoip is possible
    :param country_pool:
    :return: country name if found
    """

    g_country = httpFn.get_geoip_country()