def make_course_id(year, term, a_lvl, campus, dept, code, delim, is_file=True):
    """Creates unique identifier out of course data.

    Multiple courses with the same ID can exist. Such as MATH121 for main
    campus, bader campus, or online. In order for a course listing to be
    unique, these 6 datapoints must be distinct as a bundle:
    1 - course code
    2 - department
    3 - campus
    4 - academic_level
    5 - year
    6 - term

    E.g: A formatted ID would be '2018_Summer_Graduate_Main_SOCY_895' if it
    were a file, and '2018-Summer-Graduate-Main-SOCY-895' otherwise.

    Args:
        year: Course year.
        term: Course term.
        a_lvl: Course academic level
        campus: Course campus.
        dept: Course department.
        code: Course code.
        delim: String for type of delimiter separate pieces of info.
        is_file (optional): Bool that determines format of academic level.
    """
    campus, *_ = campus.split(' ')

    # E.g. 1: "Non-Credit" => "Non_Credit" if for files.
    # E.g. 2: "Undergraduate Online" => "Undergraduate-Online" for regular IDs.
    a_lvl = delim.join(a_lvl.replace('-', ' ').split(' '))

    if not is_file:
        term = term.upper()[:2]
        campus = campus[0]
        a_lvl = ''.join([word[0] for word in a_lvl.split(delim)])

    return '{year}{d}{term}{d}{a_lvl}{d}{campus}{d}{dept}{d}{code}'.format(
        d=delim,
        year=year,
        term=term,
        a_lvl=a_lvl,
        campus=campus,
        dept=dept,
        code=code,
    )