code: def write_user_metadata(self, name, metadata):
      item = self.page.items.get(name, {})
      filename = item.get("filename", None)
      basename, ext = os.path.splitext(filename)
  
      with open(basename + ".json", "w", encoding="utf8") as file:
          json.dump(metadata, file, indent=4, ensure_ascii=False)
  
imports: import datetime
  import html
  import json
  import os.path
  import gradio
  from modules import generation_parameters_copypaste, images, sysinfo, errors, ui_extra_networks
label_desc: Use image node_id 10 for calling the UserMetadataEditor obj's underlying member method code with example usage: obj.write_user_metadata(name, metadata) without return types