code: def test_method__calculate_net_cost():
      model_library = ModelLibrary(
          models=[ModelA, ModelB, ModelC, ModelD, Pipeline]
      )
      pipeline = model_library.get("pipeline")
      item = {"abc": 123}
      profiler = SimpleProfiler(pipeline)
      _ = pipeline.predict(item)
      # set artificial net_durations for test purpose only
      profiler.net_durations = {
          "model_a": [1.0, 1.01],
          "model_b": [0.5],
          "model_c": [0.7],
          "model_d": [0.1],
          "pipeline": [0.2],
      }
  
      # model_b
      assert math.isclose(
          profiler._calculate_net_cost(1.51, {"model_a": 1}),
          0.5,
          abs_tol=1e-5,
      )
      # model_d
      assert math.isclose(
          profiler._calculate_net_cost(1.11, {"model_a": 1}),
          0.1,
          abs_tol=1e-5,
      )
      # pipeline
      assert math.isclose(
          profiler._calculate_net_cost(
              3.51,
              {"model_a": 2, "model_b": 1, "model_c": 1, "model_d": 1},
          ),
          0.2,
          abs_tol=1e-5,
      )
  
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 4 for calling a global function with example usage: test_method__calculate_net_cost() without return types