def classNameValidator (className):
    """Checks if className is a valid class name.

    Format of string: DEPT NUM

    Allows for department names of 2-4 characters. Examples:
        - EE 101
        - FIN 310
        - CSCI 160
    Allows for lab and honors classes. Examples:
        - BIOL 150L
        - CSCI 493HON

    .. warning::
        Accounts for course MATH 98 but does NOT account for any other
        remedial courses (class numbers <100).

    :param str className: The name of the class to be validated
    :except AttributeError: className must be string
    :return: The name of class if valid, else None
    :rtype: str or None
    """
    try:
        className = className.upper()
    except AttributeError:
        return None
    if className == "MATH 98":
        return className

    # min example: "EE 101"  --> len == 6
    # max example: "CSCI 493HON" --> len == 11
    elif len (className) in range (6, 12):
        departmentClassNumberSplit = className.split ()
        if len (departmentClassNumberSplit) == 2:
            department = departmentClassNumberSplit[0]
            classNumber = departmentClassNumberSplit[1]
            #
            if (
                # department could be 2 to 4 chars
                # examples: EE, FIN, CSCI
                len (department) in range (2, 5) and
                department.isalpha () and
                len (classNumber) in range (3, 7) and
                classNumber[:3].isnumeric ()
            ):
                # account for honor and lab courses
                if (
                    len (classNumber) == 3 or
                    classNumber[3:] == "HON" or
                    classNumber[3:] == "L"
                ):
                    return className