<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _root(path, root):
    '''
    Relocate an absolute path to a new root directory.
    '''
    if root:
        return os.path.join(root, os.path.relpath(path, os.path.sep))
    else:
        return path