def get_course_masquerade(user, course_key):
 masquerade_settings = getattr(user, 'masquerade_settings', {})
 return masquerade_settings.get(course_key, None)

def get_course_masquerade ( user , course_key ) : masquerade_settings = getattr ( user , 'masquerade_settings' , { } ) return masquerade_settings . get ( course_key , None )
returns the masquerade for the current user for the specified course .