def remove_master_course_staff_from_ccx(master_course, ccx_key, display_name, send_email=True):
 list_staff = list_with_level(master_course, 'staff')
 list_instructor = list_with_level(master_course, 'instructor')
 with ccx_course(ccx_key) as course_ccx:
  list_staff_ccx = list_with_level(course_ccx, 'staff')
  list_instructor_ccx = list_with_level(course_ccx, 'instructor')
  email_params = get_email_params(course_ccx, auto_enroll=True, course_key=ccx_key, display_name=display_name)
  for staff in list_staff:
   if (staff in list_staff_ccx):
    revoke_access(course_ccx, staff, 'staff')
    unenroll_email(course_id=ccx_key, student_email=staff.email, email_students=send_email, email_params=email_params)
  for instructor in list_instructor:
   if (instructor in list_instructor_ccx):
    revoke_access(course_ccx, instructor, 'instructor')
    unenroll_email(course_id=ccx_key, student_email=instructor.email, email_students=send_email, email_params=email_params)

def remove_master_course_staff_from_ccx ( master_course , ccx_key , display_name , send_email = True ) : list_staff = list_with_level ( master_course , 'staff' ) list_instructor = list_with_level ( master_course , 'instructor' ) with ccx_course ( ccx_key ) as course_ccx : list_staff_ccx = list_with_level ( course_ccx , 'staff' ) list_instructor_ccx = list_with_level ( course_ccx , 'instructor' ) email_params = get_email_params ( course_ccx , auto_enroll = True , course_key = ccx_key , display_name = display_name ) for staff in list_staff : if ( staff in list_staff_ccx ) : revoke_access ( course_ccx , staff , 'staff' ) unenroll_email ( course_id = ccx_key , student_email = staff . email , email_students = send_email , email_params = email_params ) for instructor in list_instructor : if ( instructor in list_instructor_ccx ) : revoke_access ( course_ccx , instructor , 'instructor' ) unenroll_email ( course_id = ccx_key , student_email = instructor . email , email_students = send_email , email_params = email_params )
remove staff and instructor roles on ccx to all the staff and instructors members of master course .