code: def test_two_component_invalid_dependencies_fail(
      lightning_squeezenet1_1_obj,
  ):
      comp1 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
      comp2 = ClassificationInferenceComposable(
          lightning_squeezenet1_1_obj
      )
  
      with pytest.raises(RuntimeError, match="Cannot create cycle"):
          comp1.inputs["tag"] << comp1.outputs.predicted_tag
      with pytest.raises(RuntimeError, match="Cannot create cycle"):
          comp1.inputs.tag << comp1.outputs["predicted_tag"]
  
      with pytest.raises(AttributeError):
          comp1.inputs["tag"] >> comp2.inputs["label"]
      with pytest.raises(AttributeError):
          comp1.inputs.tag >> comp2.inputs.label
  
      with pytest.raises(AttributeError):
          comp1.inputs["tag"] >> comp2.outputs["label"]
      with pytest.raises(AttributeError):
          comp1.inputs.tag >> comp2.outputs.label
  
      with pytest.raises(TypeError):
          (
              comp2.outputs["predicted_tag"]
              >> comp1.outputs["predicted_tag"]
          )
      with pytest.raises(TypeError):
          comp2.outputs.predicted_tag >> comp1.outputs.predicted_tag
  
      class Foo:
          def __init__(self):
              pass
  
      foo = Foo()
      with pytest.raises(TypeError):
          comp1.inputs["tag"] >> foo
  
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 4 for calling a global function with example usage: test_two_component_invalid_dependencies_fail(lightning_squeezenet1_1_obj) without return types