code: def test_update_nested():
      original = {"x": {"b": {"foo": 2}, "c": 4}}
      update = {"x": {"b": {"foo": 5}, "d": 6}, "y": 40}
  
      output = update_nested(original, update, copy=True)
      assert output is not original
      assert output == {"x": {"b": {"foo": 5}, "c": 4, "d": 6}, "y": 40}
  
      output2 = update_nested(original, update)
      assert output2 is original
      assert output == output2
  
imports: import types
  from packaging.version import Version
  from importlib.metadata import version
  import numpy
  import pandas
  import pytest
  import altair
  from altair.utils.core import parse_shorthand, update_nested, infer_encoding_types
  from altair.utils.core import infer_dtype
label_desc: Use image node_id 9 for calling a global function with example usage: test_update_nested() without return types