Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def visdom_server():
import time
import subprocess
from visdom.server import download_scripts
download_scripts()
hostname = "localhost"
port = 8098
p = subprocess.Popen("visdom --hostname {} -port {}".format(hostname, port), shell=True)
time.sleep(5)
yield (hostname, port)
p.terminate()