'Serializes a course to a Python dict.'

@classmethod
def _serialize_course(cls, course, modes=None, verification_deadline=None):

    modes = (modes or [])
    verification_deadline = (verification_deadline or VerificationDeadline.deadline_for_course(course.id))
    return {u'id': unicode(course.id), u'name': unicode(course.display_name), u'verification_deadline': cls._serialize_datetime(verification_deadline), u'modes': [cls._serialize_course_mode(mode) for mode in modes]}
