code: def test_basic_tikz():
      expected_tex = r"""\documentclass{report}
  \usepackage{tikz}
  \usepackage{subcaption}
  
  \begin{document}
  \begin{figure}
    \begin{subfigure}{0.5\textwidth}
    \begin{tikzpicture}[scale=2]
        \draw[gray!90]
          (0.749, 0.702) node[red!90] (0){0}
          (1.0, -0.014) node[red!90] (1){1}
          (-0.777, -0.705) node (2){2}
          (-0.984, 0.042) node (3){3}
          (-0.028, 0.375) node[cyan!90] (4){4}
          (-0.412, 0.888) node (5){5}
          (0.448, -0.856) node (6){6}
          (0.003, -0.431) node[cyan!90] (7){7};
        \begin{scope}[->,gray!90]
          \draw (0) to (4);
          \draw (0) to (5);
          \draw (0) to (6);
          \draw (0) to (7);
          \draw (1) to (4);
          \draw (1) to (5);
          \draw (1) to (6);
          \draw (1) to (7);
          \draw (2) to (4);
          \draw (2) to (5);
          \draw (2) to (6);
          \draw (2) to (7);
          \draw (3) to (4);
          \draw (3) to (5);
          \draw (3) to (6);
          \draw (3) to (7);
        \end{scope}
      \end{tikzpicture}
      \caption{My tikz number 1 of 2}\label{tikz_1_2}
    \end{subfigure}
    \begin{subfigure}{0.5\textwidth}
    \begin{tikzpicture}[scale=2]
        \draw[gray!90]
          (0.749, 0.702) node[green!90] (0){0}
          (1.0, -0.014) node[green!90] (1){1}
          (-0.777, -0.705) node (2){2}
          (-0.984, 0.042) node (3){3}
          (-0.028, 0.375) node[purple!90] (4){4}
          (-0.412, 0.888) node (5){5}
          (0.448, -0.856) node (6){6}
          (0.003, -0.431) node[purple!90] (7){7};
        \begin{scope}[->,gray!90]
          \draw (0) to (4);
          \draw (0) to (5);
          \draw (0) to (6);
          \draw (0) to (7);
          \draw (1) to (4);
          \draw (1) to (5);
          \draw (1) to (6);
          \draw (1) to (7);
          \draw (2) to (4);
          \draw (2) to (5);
          \draw (2) to (6);
          \draw (2) to (7);
          \draw (3) to (4);
          \draw (3) to (5);
          \draw (3) to (6);
          \draw (3) to (7);
        \end{scope}
      \end{tikzpicture}
      \caption{My tikz number 2 of 2}\label{tikz_2_2}
    \end{subfigure}
    \caption{A graph generated with python and latex.}
  \end{figure}
  \end{document}"""
  
      edges = [
          (0, 4),
          (0, 5),
          (0, 6),
          (0, 7),
          (1, 4),
          (1, 5),
          (1, 6),
          (1, 7),
          (2, 4),
          (2, 5),
          (2, 6),
          (2, 7),
          (3, 4),
          (3, 5),
          (3, 6),
          (3, 7),
      ]
      G = nx.DiGraph()
      G.add_nodes_from(range(8))
      G.add_edges_from(edges)
      pos = {
          0: (0.7490296171687696, 0.702353520257394),
          1: (1.0, -0.014221357723796535),
          2: (-0.7765783344161441, -0.7054170966808919),
          3: (-0.9842690223417624, 0.04177547602465483),
          4: (-0.02768523817180917, 0.3745724439551441),
          5: (-0.41154855146767433, 0.8880106515525136),
          6: (0.44780153389148264, -0.8561492709269164),
          7: (0.0032499953371383505, -0.43092436645809945),
      }
  
      rc_node_color = {
          0: "red!90",
          1: "red!90",
          4: "cyan!90",
          7: "cyan!90",
      }
      gp_node_color = {
          0: "green!90",
          1: "green!90",
          4: "purple!90",
          7: "purple!90",
      }
  
      H = G.copy()
      nx.set_node_attributes(G, rc_node_color, "color")
      nx.set_node_attributes(H, gp_node_color, "color")
  
      sub_captions = ["My tikz number 1 of 2", "My tikz number 2 of 2"]
      sub_labels = ["tikz_1_2", "tikz_2_2"]
  
      output_tex = nx.to_latex(
          [G, H],
          [pos, pos],
          tikz_options="[scale=2]",
          default_node_options="gray!90",
          default_edge_options="gray!90",
          node_options="color",
          sub_captions=sub_captions,
          sub_labels=sub_labels,
          caption="A graph generated with python and latex.",
          n_rows=2,
          as_document=True,
      )
  
      assert output_tex == expected_tex
  
file_path: networkx/networkx/drawing/tests/test_latex.py
imports: import pytest
  import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: test_basic_tikz() without return types