code: def visualise_nn(nn, save_file_prefix, fig_label=None, for_pres=True):
      """The main API which will be used to visualise the network."""
      # First create nodes in the order
      nodes = [
          _get_layer(i, nn, for_pres) for i in range(nn.num_layers)
      ]
      edges = _get_edges(nn.conn_mat)
      nn_graph = GV_DIGRAPH()
      add_nodes(nn_graph, nodes)
      add_edges(nn_graph, edges)
      graph_styles = _GRAPH_STYLES
      graph_styles["graph"]["label"] = fig_label
      apply_styles(nn_graph, graph_styles)
      nn_graph.render(save_file_prefix)
      if os.path.exists(save_file_prefix):
          # graphviz also creates another file in the name of the prefix. delete it.
          os.remove(save_file_prefix)
  
file_path: dragonfly/dragonfly/nn/nn_visualise.py
imports: import functools
  import os
label_desc: Use image node_id 9 for calling a global function with example usage: visualise_nn(nn, save_file_prefix, fig_label, for_pres) without return types