Blender Python path directory for file output node
You can just add ../.. at the end of your absolutepath, like this

node.base_path = absolutepath+'../..'


or if you insist on getting the actual path cleanly, you can use the python os module to split the path into parts and then join them again except the last two

import bpy
import os

 # Get absolute path:
filepath = bpy.context.scene.render.filepath
absolutepath = bpy.path.abspath(filepath)

path = os.path.normpath(absolutepath)
parts = path.split(os.sep)

absolutepath = os.sep.join(parts[:-2])

# set the path for all file output nodes:
for scene in bpy.data.scenes:
    for node in scene.node_tree.nodes:
        if node.type == 'OUTPUT_FILE':
            node.base_path = absolutepath


If you want this to work even if your original path has a filename in the end, add 

absolutepath, file = os.path.split(absolutepath)


before path = os.path.normpath(absolutepath)