code: def test_model_compute_dependencies(lightning_squeezenet1_1_obj):
      comp1 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
      comp2 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
  
      comp1.inputs.tag << comp2.outputs.predicted_tag
      res = [
          {
              "source_component": "callnum_2",
              "source_key": "predicted_tag",
              "target_component": "callnum_1",
              "target_key": "tag",
          }
      ]
      assert [
          x._asdict() for x in comp1._flashserve_meta_.connections
      ] == res
      assert list(comp2._flashserve_meta_.connections) == []
  
file_path: lightning-flash/tests/core/serve/test_components.py
imports: import pytest
  import torch
  from flash.core.serve.types import Label
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
  from tests.core.serve.models import ClassificationInferenceComposable, LightningSqueezenet
label_desc: Use image node_id 2 for calling a global function with example usage: test_model_compute_dependencies(lightning_squeezenet1_1_obj) without return types