def get_wf_graph_remotely(path_to_vistrails, download_url, host, db_name, vt_id,
                           version, port, path_to_figures, build_always=False, 
                           tag='', pdf=False, embedWorkflow=False, 
                           includeFullTree=False):
    log("get_wf_graph_remotely") 
    
    if build_always:
        #force to remove the folder so we avoid stale results
        if os.path.exists(path_to_figures):
            shutil.rmtree(path_to_figures)
            
    if not path_exists_and_not_empty(path_to_figures) or build_always:
        if not os.path.exists(path_to_figures):
            os.makedirs(path_to_figures)
        
        if check_url(path_to_vistrails):
            website = "://".join(urlparse(path_to_vistrails)[:2])
            request = "?host=%s&db=%s&vt=%s&version=%s&port=%s&pdf=%s&showworkflow=True" % (host,
                                                                   db_name,
                                                                   vt_id,
                                                                   urllib2.quote(version),
                                                                   port,
                                                                   pdf)
            url = path_to_vistrails + request
            log("will download from: " + url)
            
            (result, msg) = _download_content(website, url, path_to_figures)
            if result == True:
                log("success")
                return (result, generate_latex_db(False, download_url, host, db_name, 
                                               vt_id, version, 
                                               port, tag, False,
                                               False,
                                               path_to_figures, 
                                               graphics_options,
                                               embedWorkflow, includeFullTree))
            else:
                log("Error: " + msg)
                return (result, generate_latex_error(msg))
        else:
            msg = "Invalid url: %s" % path_to_vistrails
            log("Error: " + msg)
            return (False, generate_latex_error(msg))
    else:
        log("using cached files")
        return (True, generate_latex_db(False, download_url, host, db_name, vt_id, 
                                     version, port, tag, 
                                     False, False,
                                     path_to_figures, graphics_options,
                                     embedWorkflow, includeFullTree))
            
###############################################################################
get_wf_graph_remotely(path_to_vistrails: str, download_url:str, host: str,
dataset/ETHPy150Open VisTrails/VisTrails/extensions/latex/includevistrail.py/get_wf_graph_remotely