parameters: (out, svg_code=None, svg_file=None)
return_statement: return None
docstring: Writes an SVG to a PNG
docstring_summary: Writes an SVG to a PNG
docstring_tokens: Writes an SVG to a PNG
function: def _svg_to_png(out, svg_code=None, svg_file=None):
      """Writes an SVG to a PNG"""
      try:
          from cairosvg import svg2png
  
          lbl = _get_label(out)
          if svg_code is not None:
              print(f"[{lbl}]|0> Outputting '{out}'...")
              svg2png(svg_code, write_to=out)
              return out
          elif svg_file is not None:
              print(f"[{lbl}]|0> Outputting '{out}'...")
              _create_directory(svg_file)
              with open(svg_file, "r") as fin:
                  svg2png(fin, write_to=out)
          else:
              raise RuntimeError("Error! No svg_code or svg_file")
  
      except ImportError as e:
          print(e)
          print("Install 'cairosvg' for conversion from SVG to PNG")
  
      return None
function_tokens: def _svg_to_png ( out , svg_code = None , svg_file = None ) : try : from cairosvg import svg2png lbl = _get_label ( out ) if svg_code is not None : print ( f"[{lbl}]|0> Outputting '{out}'..." ) svg2png ( svg_code , write_to = out ) return out elif svg_file is not None : print ( f"[{lbl}]|0> Outputting '{out}'..." ) _create_directory ( svg_file ) with open ( svg_file , "r" ) as fin : svg2png ( fin , write_to = out ) else : raise RuntimeError ( "Error! No svg_code or svg_file" ) except ImportError as e : print ( e ) print ( "Install 'cairosvg' for conversion from SVG to PNG" ) return None