import requests
import json


def fetch_entanglement_graph(host="proxy", port=8000, path="/dict"):
    """
    Fetches the entanglement graph from a running instance of playcloud.
    Args:
        host(str, optional): Host of the playcloud instance
        port(int, optional): Port number of the listening playcloud instance
        path(str, optional): Path of the endpoint on the playcloud server that dumps the graph
    Returns:
        dict: The entanglement graph
    """
    url = "http://{:s}:{:d}{:s}".format(host, port, path)
    req = requests.get(url)
    assert req.status_code == 200
    graph = json.loads(req.text)
    return graph