Accepts an international form of a phone number (+ followed by digits),
    and returns a two-character country code.

    :param phone_number:
        The string phone number, in international format with leading +

    :return:
        A two-character string or None if no match

def _lookup_country_code(phone_number):
    """
    Accepts an international form of a phone number (+ followed by digits),
    and returns a two-character country code.

    :param phone_number:
        The string phone number, in international format with leading +

    :return:
        A two-character string or None if no match
    """

    leading_digit = phone_number[0]

    if leading_digit not in CALLING_CODE_MAPPING:
        return None

    for mapping in CALLING_CODE_MAPPING[leading_digit]:
        if not re.match(mapping['regex'], phone_number):
            continue
        return mapping['country_code']

    return None