def get_completed_courses(student):
 all_certs = certificate_api.get_certificates_for_user(student.username)
 return [{'course_id': unicode(cert['course_key']), 'mode': cert['type']} for cert in all_certs if certificate_api.is_passing_status(cert['status'])]

def get_completed_courses ( student ) : all_certs = certificate_api . get_certificates_for_user ( student . username ) return [ { 'course_id' : unicode ( cert [ 'course_key' ] ) , 'mode' : cert [ 'type' ] } for cert in all_certs if certificate_api . is_passing_status ( cert [ 'status' ] ) ]
determine which courses have been completed by the user .