takes a document graph and strips all the information that aren't
    necessary for visualizing it with graphviz. ensures that all
    node/edge names and labels are properly quoted.

    Parameters
    ----------
    docgraph : DiscourseDocumentGraph
        a document graph
    Returns
    -------
    stripped_graph : networkx.MultiDiGraph
        a graph containing only information that is needed for graphviz

def preprocess_for_pydot(docgraph):
    """
    takes a document graph and strips all the information that aren't
    necessary for visualizing it with graphviz. ensures that all
    node/edge names and labels are properly quoted.

    Parameters
    ----------
    docgraph : DiscourseDocumentGraph
        a document graph
    Returns
    -------
    stripped_graph : networkx.MultiDiGraph
        a graph containing only information that is needed for graphviz
    """
    stripped_graph = nx.MultiDiGraph()
    stripped_graph.name = docgraph.name

    nodes = _preprocess_nodes_for_pydot(docgraph.nodes_iter(data=True))
    edges = _preprocess_edges_for_pydot(docgraph.edges_iter(data=True))

    stripped_graph.add_nodes_from(nodes)
    stripped_graph.add_edges_from(edges)
    return stripped_graph