code: def test_merge_dicts():
      dict_a = {"a": 3, "b": {"c": {"d": [1, 2, 3]}}, "k": "hello"}
      dict_b = {"test_var": [1, 2]}
      expected_ab = {
          "a": 3,
          "b": {"c": {"d": [1, 2, 3]}},
          "k": "hello",
          "test_var": [1, 2],
      }
      assert merge_dicts(dict_a, dict_b) == expected_ab
  
      dict_c = {"a": 10}
      with pytest.raises(ValueError, match="contains duplicate keys"):
          merge_dicts(dict_a, dict_c)
  
      expected_ac = {
          "a": 10,
          "b": {"c": {"d": [1, 2, 3]}},
          "k": "hello",
      }
      assert (
          merge_dicts(dict_a, dict_c, raise_on_duplicates=False)
          == expected_ac
      )
  
file_path: mlflow/tests/utils/test_utils.py
imports: from unittest import mock
  import pytest
  from mlflow.utils import _chunk_dict, _get_fully_qualified_class_name, _truncate_dict, get_unique_resource_id, merge_dicts
label_desc: Use image node_id 4 for calling a global function with example usage: test_merge_dicts() without return types