code: def test_merge_dict():
      d1 = {"Train": {"us": {"lr": 10}}}
      d2 = {"Train": {"us": {"layers": 100}}}
  
      c1 = Context(d1)
      c2 = Context(d2)
  
      c1.merge_update(c2)
      assert c1.select("Train.us") == CtxDict(lr=10, layers=100)
  
      with pytest.raises(MergeError):
          # cannot overwrite by default
          c1.merge_update({"Train": {"us": {"lr": 15}}})
  
      c1.merge_update({"Train": {"us": {"lr": 15}}}, overwrite=True)
      node = c1.select("Train.us")
      assert node == {"lr": 15, "layers": 100}
      assert isinstance(node, CtxDict)
      assert node["lr"] == Value(15)
      assert node["layers"] == Value(100)
  
imports: from dataclasses import asdict
  from math import pi
  import pytest
  from dvc.fs import LocalFileSystem
  from dvc.parsing import DEFAULT_PARAMS_FILE
  from dvc.parsing.context import Context, CtxDict, CtxList, KeyNotInContext, MergeError, ParamsLoadError, Value, recurse_not_a_node
  from dvc.utils import relpath
  from dvc.utils.serialize import dumps_yaml
label_desc: Use image node_id 9 for calling a global function with example usage: test_merge_dict() without return types