code: def test_convert_networkx_graph():
      doc = CoNLL.conll2doc(
          input_str=ESTONIAN_EMPTY_DEPS, ignore_gapping=False
      )
      deps = doc.sentences[0]._enhanced_dependencies
  
      graph = DependencyGraph()
      java_protobuf_requests.convert_networkx_graph(
          graph, doc.sentences[0], 0
      )
      assert len(graph.rootNode) == 1
      assert graph.rootNode[0] == 0
      nodes = sorted([(x.index, x.emptyIndex) for x in graph.node])
      expected_nodes = [
          (1, 0),
          (2, 0),
          (3, 0),
          (4, 0),
          (5, 0),
          (5, 1),
          (6, 0),
          (7, 0),
      ]
      assert nodes == expected_nodes
  
      edges = [
          (x.target, x.dep)
          for x in graph.edge
          if x.source == 5 and x.sourceEmpty == 1
      ]
      edges = sorted(edges)
      expected_edges = [
          (1, "cc"),
          (3, "obl"),
          (5, "advmod"),
          (6, "obl"),
          (7, "punct"),
      ]
      assert edges == expected_edges
  
file_path: stanza/stanza/tests/server/test_java_protobuf_requests.py
imports: import tempfile
  import pytest
  from stanza.models.common.utils import misc_to_space_after, space_after_to_misc
  from stanza.models.constituency import tree_reader
  from stanza.server import java_protobuf_requests
  from stanza.tests import *
  from stanza.utils.conll import CoNLL
  from stanza.protobuf import DependencyGraph
label_desc: Use image node_id 3 for calling a global function with example usage: test_convert_networkx_graph() without return types