def _remove_in_process_courses(courses, in_process_course_actions):
 def format_course_for_view(course):
  '\n        Return a dict of the data which the view requires for each course\n        '
  return {'display_name': course.display_name, 'course_key': unicode(course.location.course_key), 'url': reverse_course_url('course_handler', course.id), 'lms_link': get_lms_link_for_item(course.location), 'rerun_link': _get_rerun_link_for_item(course.id), 'org': course.display_org_with_default, 'number': course.display_number_with_default, 'run': course.location.run}
 in_process_action_course_keys = [uca.course_key for uca in in_process_course_actions]
 courses = [format_course_for_view(course) for course in courses if ((not isinstance(course, ErrorDescriptor)) and (course.id not in in_process_action_course_keys))]
 return courses

def _remove_in_process_courses ( courses , in_process_course_actions ) : def format_course_for_view ( course ) : return { 'display_name' : course . display_name , 'course_key' : unicode ( course . location . course_key ) , 'url' : reverse_course_url ( 'course_handler' , course . id ) , 'lms_link' : get_lms_link_for_item ( course . location ) , 'rerun_link' : _get_rerun_link_for_item ( course . id ) , 'org' : course . display_org_with_default , 'number' : course . display_number_with_default , 'run' : course . location . run } in_process_action_course_keys = [ uca . course_key for uca in in_process_course_actions ] courses = [ format_course_for_view ( course ) for course in courses if ( ( not isinstance ( course , ErrorDescriptor ) ) and ( course . id not in in_process_action_course_keys ) ) ] return courses
removes any in-process courses in courses list .