code: def patch_to_dict(p):
      return json.loads(to_json(p))
  
imports: import json
  import pytest
  from dash import Patch
  from dash._utils import to_json
label_desc: Use image node_id 1 for calling a global function with example usage: patch_to_dict(p) and returns: json