import re


def get_year_season_from_edx_key(parsed_course_key):
    """
    Verifies that a parsed course key matches our expected format and returns a year/season

    Args:
        parsed_course_key (str): A semester/year indicator from a course key (eg: '1T2016')

    Returns:
        tuple: (Year, Season number)
    """
    found = re.search('^[1-3]T[1|2][0-9]{3}$', parsed_course_key)
    if found:
        season_year_tuple = found.group().split('T')
        return int(season_year_tuple[1]), int(season_year_tuple[0])
    return ()