code: def dot2svg(dot):
      # type: (str) -> str
      
      svg = graphviz.Source(dot).pipe(format='svg').decode('utf8')  # type: str
      # strip doctype and xml declaration
      svg = svg[svg.index('<svg'):]
      return svg
docs: Render Graphviz data to SVG