code: def test_connection_invalid_raises(lightning_squeezenet1_1_obj):
      comp1 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
  
      with pytest.raises(
          RuntimeError,
          match="Cannot compose a parameters of same components",
      ):
          (
              comp1.outputs["predicted_tag"]
              >> comp1.outputs["predicted_tag"]
          )
  
      class FakeParam:
          position = "outputs"
  
      fake_param = FakeParam()
  
      with pytest.raises(
          TypeError, match="Can only Compose another `Parameter`"
      ):
          comp1.outputs.predicted_tag >> fake_param
  
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 8 for calling a global function with example usage: test_connection_invalid_raises(lightning_squeezenet1_1_obj) without return types