code: def test_to_dict_with_custom_class():
      component = MergeLoop(
          expected_type=MergeLoop, inputs=["first", "second"]
      )
      res = component.to_dict()
      assert res == {
          "type": "haystack.testing.sample_components.merge_loop.MergeLoop",
          "init_parameters": {
              "expected_type": "haystack.testing.sample_components.merge_loop.MergeLoop",
              "inputs": ["first", "second"],
          },
      }
  
file_path: haystack/test/core/sample_components/test_merge_loop.py
imports: from typing import Dict
  import pytest
  from haystack.core.errors import DeserializationError
  from haystack.testing.sample_components import MergeLoop
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_dict_with_custom_class() without return types