code: def test_pipeline_resolution_duplicate_input_names_across_components():
      @component
      class Hello:
          @component.output_types(output=str)
          def run(self, who: str, what: str):
              return {"output": f"Hello {who} {what}!"}
  
      pipe = Pipeline()
      pipe.add_component("hello", Hello())
      pipe.add_component("hello2", Hello())
  
      pipe.connect("hello.output", "hello2.who")
  
      result = pipe.run(data={"what": "Haystack", "who": "world"})
      assert result == {
          "hello2": {"output": "Hello Hello world Haystack! Haystack!"}
      }
  
      resolved, _ = pipe._prepare_component_input_data(
          data={"what": "Haystack", "who": "world"}
      )
  
      # why does hello2 have only one input? Because who of hello2 is inserted from hello.output
      assert resolved == {
          "hello": {"what": "Haystack", "who": "world"},
          "hello2": {"what": "Haystack"},
      }
  
file_path: haystack/test/test_pipeline.py
imports: from typing import Optional
  import pytest
  from haystack import Pipeline, component
label_desc: Use image node_id 9 for calling a global function with example usage: test_pipeline_resolution_duplicate_input_names_across_components() and returns: dict