code: def test_to_dict_with_custom_function():
      accumulate = Accumulate(function=my_subtract)
      res = accumulate.to_dict()
      assert res == {
          "type": "haystack.testing.sample_components.accumulate.Accumulate",
          "init_parameters": {
              "function": "test_accumulate.my_subtract"
          },
      }
  
file_path: haystack/test/core/sample_components/test_accumulate.py
imports: from haystack.testing.sample_components.accumulate import Accumulate, _default_function
label_desc: Use image node_id 3 for calling a global function with example usage: test_to_dict_with_custom_function() without return types