def get_term_code(term):
    """Converts different variations of term codes into the yyyymm format for HTTP requests
    
    acceptable codes include:  FALL09, 2016-FALL, SUMMER-2017, 2016SUMMER, 2017-WINTER
    """
    part_codes = {'FALL': '09', 'FALL-SUP': '10', 'WINTER': '01',
        'WINTER-SUP': '02', 'SUMMER': '05', 'SUMMER-SUP': '06'}
    if term == 'PREVIOUSEDUCATION':
        return '000000'
    elif term.isdigit():
        return term
    elif term[0].isdigit():
        year = term[0:4]
        if term[4] == '-':
            part = term[5:]
        else:
            part = term[4:]
        part = part_codes[part.upper()]
    else:
        year = term[-4:]
        if term[-5] == '-':
            part = term[:-5]
        else:
            part = term[:-4]
        part = part_codes[part.upper()]
    return year + part
