def get_masquerading_group_info(user, course_key):
 course_masquerade = get_course_masquerade(user, course_key)
 if (not course_masquerade):
  return (None, None)
 return (course_masquerade.group_id, course_masquerade.user_partition_id)

def get_masquerading_group_info ( user , course_key ) : course_masquerade = get_course_masquerade ( user , course_key ) if ( not course_masquerade ) : return ( None , None ) return ( course_masquerade . group_id , course_masquerade . user_partition_id )
if the user is masquerading as belonging to a group .