<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_active_window_pos():
    '''screen coordinates massaged so that movewindow command works to
    restore the window to the same position
    returns x, y
    '''
    # http://stackoverflow.com/questions/26050788/in-bash-on-ubuntu-14-04-unity-how-can-i-get-the-total-size-of-an-open-window-i/26060527#26060527
    cmd = ['xdotool','getactivewindow', 'getwindowgeometry']
    res = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr= subprocess.PIPE).communicate()
    stdout = res[0].decode('utf-8').splitlines()
    pos = stdout[1].split(':')[1].split(',')
    geo = stdout[2].split(':')[1].split('x')
    x, y = int(pos[0].strip()), int(pos[1].split('(')[0].strip())
    w, h = int(geo[0].strip()), int(geo[1].strip())

    # get the window decorations
    window_id = get_window_id()
    cmd = ['xprop', '_NET_FRAME_EXTENTS', '-id', window_id]
    res = subprocess.Popen(cmd, stdout = subprocess.PIPE, stderr= subprocess.PIPE).communicate()
    decos = res[0].decode('utf-8').split('=')[1].split(',')
    l, r = int(decos[0].strip()), int(decos[1].strip())
    t, b = int(decos[2].strip()), int(decos[3].strip())

    return x-l, y-t