code: def plot_pretty_structure(
      g: StructureModel,
      edges_to_highlight: Tuple[str, str],
      default_weight: float = 0.2,
      weighted: bool = False,
  ):
      """
      Utility function to plot our networks in a pretty format
      Args:
          g: Structure model (directed acyclic graph)
          edges_to_highlight: List of edges to highlight in the plots
          default_weight: Default edge weight
          weighted: Whether the graph is weighted
      Returns:
          a styled pygraphgiz graph that can be rendered as an image
      """
  
      # Making all nodes hexagonal with black coloring
      all_node_attributes = {
          "font": {
              "color": "#FFFFFFD9",
              "face": "Helvetica",
              "size": 20,
          },
          "shape": "hexagon",
          "borderWidth": 2,
          "color": {
              "border": "#4a90e2d9",
              "background": "grey",
              "highlight": {
                  "border": "#0059b3",
                  "background": "#80bfff",
              },
          },
          "mass": 3,
      }
  
      # Customising edges
      if weighted:
          edge_weights = [
              (u, v, w if w else default_weight)
              for u, v, w in g.edges(data="weight")
          ]
      else:
          edge_weights = [(u, v, default_weight) for u, v in g.edges()]
  
      edge_attributes = {
          (u, v): {
              "penwidth": w * 20 + 2,  # Setting edge thickness
              "width": int(
                  10 * w
              ),  # Higher "weight"s mean shorter edges
              "arrowsize": 2 - 2.0 * w,  # Avoid too large arrows
              "arrowtail": "dot",
              "color": "#DF5F00"
              if ((u, v) in set(edges_to_highlight))
              else "#888888",
          }
          for u, v, w in edge_weights
      }
  
      return plot_structure(
          g,
          all_node_attributes=all_node_attributes,
          edge_attributes=edge_attributes,
      )
  
imports: import json
  import multiprocessing
  import os
  import warnings
  from collections import defaultdict
  from time import time
  from typing import List, Tuple
  import dataframe_image
  import networkx
  import numpy
  import pandas
  from IPython.core.display import display
  from IPython.display import Image
  from sklearn import metrics
  from sklearn.model_selection import KFold
  from causalnex.evaluation import roc_auc
  from causalnex.inference import InferenceEngine
  from causalnex.network import BayesianNetwork
  from causalnex.plots import plot_structure
  from causalnex.structure import StructureModel
label_desc: Use image node_id 2 for calling a global function with example usage: plot_pretty_structure(g, edges_to_highlight, default_weight, weighted) and returns: plot_structure