code: def draw_to_file(layers, filename, **kwargs):
      
      layers = (layers.get_all_layers() if hasattr(layers, 'get_all_layers')
                else layers)
      dot = make_pydot_graph(layers, **kwargs)
      ext = filename[filename.rfind('.') + 1:]
      with io.open(filename, 'wb') as fid:
          fid.write(dot.create(format=ext))
docs: Draws a network diagram to a file
      :parameters:
          - layers : list or NeuralNet instance
              List of layers or the neural net to draw.
          - filename : string
              The filename to save output to
          - **kwargs: see docstring of make_pydot_graph for other options