from pytz import all_timezones_set, country_timezones, country_names


def find_timezone_name(tz_name):
    """
    Return list of matching timezones by name, country code, or country name.
    Search is case insensitive.
    """
    if tz_name in all_timezones_set:
        return [tz_name]
    # Case insensitive matching:
    tz_name = tz_name.upper()
    timzones = {tz.upper(): tz for tz in all_timezones_set}
    if tz_name in timzones:
        return [timzones[tz_name]]
    # Select by country code:
    if tz_name in country_timezones:
        return country_timezones[tz_name]
    # Select by country name:
    country_codes = {
        name.upper(): code for code, name in country_names.items()}
    if tz_name in country_codes:
        return country_timezones[country_codes[tz_name]]
    return []