code: def test_network_analysis(network_data, unittest):
      import dtale.views as views
  
      df, _ = views.format_data(network_data)
      with build_app(url=URL).test_client() as c:
          build_data_inst({c.port: df})
  
          resp = c.get(
              "/dtale/network-analysis/{}".format(c.port),
              query_string={
                  "to": "to",
                  "from": "from",
                  "weight": "weight",
              },
          )
          unittest.assertEqual(
              resp.json["data"],
              {
                  "avg_weight": 2.68,
                  "edge_ct": 36,
                  "leaf_ct": 3,
                  "max_edge": "10 (source: h, target: j)",
                  "min_edge": "1 (source: j, target: k)",
                  "most_connected_node": "g (Connections: 5)",
                  "node_ct": 14,
                  "triangle_ct": 2,
              },
          )
  
imports: import pytest
  from dtale.app import build_app
  from tests.dtale import build_data_inst
  from tests.dtale.test_views import URL
label_desc: Use image node_id 3 for calling a global function with example usage: test_network_analysis(network_data, unittest) without return types