'Renders the image using pygraphviz'

def render_output_pygraphviz(self, dotdata, **kwargs):

    if (not HAS_PYGRAPHVIZ):
        raise CommandError('You    need    to    install    pygraphviz    python    module')
    version = pygraphviz.__version__.rstrip('-svn')
    try:
        if (tuple((int(v) for v in version.split('.'))) < (0, 36)):
            import tempfile
            tmpfile = tempfile.NamedTemporaryFile()
            tmpfile.write(dotdata)
            tmpfile.seek(0)
            dotdata = tmpfile.name
    except ValueError:
        pass
    graph = pygraphviz.AGraph(dotdata)
    graph.layout(prog=kwargs['layout'])
    graph.draw(kwargs['outputfile'])
