code: def simple_networkx_small_graph(directed=True):
      if directed:
          G = nx.DiGraph()
      else:
          G = nx.Graph()
      G.add_node(0, node_label=0)
      G.add_node(1, node_label=1)
      G.add_node(2, node_label=2)
      G.add_node(3, node_label=0)
      G.add_node(4, node_label=1)
  
      G.add_edge(0, 1, edge_label=0)
      G.add_edge(0, 4, edge_label=1)
      G.add_edge(1, 2, edge_label=3)
      G.add_edge(1, 3, edge_label=3)
      G.add_edge(2, 4, edge_label=0)
  
      return G
  
imports: import numpy
  import networkx
  import random
  import torch
  import itertools
label_desc: Use image node_id 2 for calling a global function with example usage: simple_networkx_small_graph(directed) and returns: G