<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def print_dot(docgraph):
 """ converts a document graph into a dot file and returns it as a string. If this function call is prepended by %dotstr, it will display the given document graph as a dot/graphviz graph in the currently running IPython notebook session. To use this function, the gvmagic IPython notebook extension needs to be installed once:: %install_ext https://raw.github.com/cjdrake/ipython-magic/master/gvmagic.py In order to visualize dot graphs in your currently running IPython notebook, run this command once:: %load_ext gvmagic """

    stripped_graph = preprocess_for_pydot(docgraph)
    return nx.drawing.nx_pydot.to_pydot(stripped_graph).to_string()