'Show SVG representation of the transducer (IPython magic).
>>> dg = DependencyGraph(
...     \'John N 2\n\'
...     \'loves V 0\n\'
...     \'Mary N 2\'
>>> dg._repr_svg_().split(\'\n\')[0]
\'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\''

def _repr_svg_(self):

    dot_string = self.to_dot()
    try:
        process = subprocess.Popen([u'dot', u'-Tsvg'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
    except OSError:
        raise Exception(u'Cannot    find    the    dot    binary    from    Graphviz    package')
    (out, err) = process.communicate(dot_string)
    if err:
        raise Exception(u'Cannot    create    svg    representation    by    running    dot    from    string:    {}'.format(dot_string))
    return out
