The problem is COURSES_WITH_UNSAFE_CODE could be regexes, i.e. all courses starting with BerkeleyX...  I don't think we have a nice way to do a comparison of that sort against CourseKeys.