<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_root(w):
 """ Simple method to access root for a widget """

    next_level = w
    while next_level.master:
        next_level = next_level.master
    return next_level