def parent_dir(path):
 return os.path.abspath(os.path.join(path, os.pardir))

def parent_dir ( path ) : return os . path . abspath ( os . path . join ( path , os . pardir ) )
return the parent of a directory .