code: def test_method__compute_sub_calls_and_update_graph_calls():
      model_library = ModelLibrary(
          models=[ModelA, ModelB, ModelC, ModelD, Pipeline]
      )
      pipeline = model_library.get("pipeline")
      item = {"abc": 123}
      profiler = SimpleProfiler(pipeline)
      _ = pipeline.predict(item)
      assert profiler._compute_sub_calls_and_update_graph_calls(
          "pipeline", {}
      ) == {
          "model_a": 2,
          "model_c": 1,
          "model_b": 1,
          "model_d": 1,
      }
      assert (
          profiler.graph_calls["pipeline"]["__main__"] == 2
      )  # _compute_sub_calls_and_update_graph_calls increnment "__main__"
  
      assert (
          profiler._compute_sub_calls_and_update_graph_calls(
              "model_a", {}
          )
          == {}
      )
      assert (
          profiler.graph_calls["model_a"]["__main__"] == 3
      )  # _compute_sub_calls_and_update_graph_calls increnment "__main__"
  
      assert profiler._compute_sub_calls_and_update_graph_calls(
          "model_b", {"model_a": 2}
      ) == {"model_a": 1}
      assert (
          profiler.graph_calls["model_b"]["__main__"] == 2
      )  # _compute_sub_calls_and_update_graph_calls increnment "__main__"
  
      assert (
          profiler._compute_sub_calls_and_update_graph_calls(
              "model_c", {}
          )
          == {}
      )
      assert (
          profiler.graph_calls["model_c"]["__main__"] == 2
      )  # _compute_sub_calls_and_update_graph_calls increnment "__main__"
  
      assert profiler._compute_sub_calls_and_update_graph_calls(
          "model_d", {"model_a": 2}
      ) == {"model_a": 1}
      assert profiler.graph_calls["model_d"]["__main__"] == 2
  
imports: import math
  import time
  from typing import Any, Dict
  import pytest
  from modelkit.core import ModelLibrary
  from modelkit.core.model import Model
  from modelkit.core.profilers.simple import SimpleProfiler
label_desc: Use image node_id 3 for calling a global function with example usage: test_method__compute_sub_calls_and_update_graph_calls() without return types