code: def test_pat004_patch_nested_assign():
      p = Patch()
  
      p["nest_item"]["nested"]["deep"] = "deep"
      p.nest_attr.nested.deep = "deep"
  
      data = patch_to_dict(p)
  
      assert data["operations"][0]["location"] == [
          "nest_item",
          "nested",
          "deep",
      ]
      assert data["operations"][1]["location"] == [
          "nest_attr",
          "nested",
          "deep",
      ]
  
imports: import json
  import pytest
  from dash import Patch
  from dash._utils import to_json
label_desc: Use image node_id 5 for calling a global function with example usage: test_pat004_patch_nested_assign() without return types