code: def write(self, data, metadata: dict = None):
      self.artifact.consumed()
      if not hasattr(self, "_has_write"):
          setattr(self, "_has_write", True)
      else:
          raise RuntimeError(
              f"json model writer {self.artifact} has been written, cannot write again"
          )
  
      path = Path(self.artifact.uri.path)
      path.parent.mkdir(parents=True, exist_ok=True)
      with path.open("w") as fw:
          json.dump(data, fw)
      if metadata is None:
          metadata = {}
      self.artifact.metadata.metadata = metadata
  
      # update model overview
      from fate.components.core.spec.model import MLModelModelSpec
  
      model_overview = self.artifact.metadata.model_overview
      model_overview.party.models.append(
          MLModelModelSpec(
              name="",
              created_time=datetime.datetime.now().isoformat(),
              file_format="json",
              metadata=metadata,
          )
      )
  
file_path: FATE/python/fate/components/core/component_desc/artifacts/model/_json.py
imports: import datetime
  import json
  import typing
  from pathlib import Path
  from fate.components.core.essential import JsonModelArtifactType
  from .._base_type import URI, ArtifactDescribe, Metadata, ModelOutputMetadata, _ArtifactType, _ArtifactTypeReader, _ArtifactTypeWriter
label_desc: Use image node_id 1 for calling the JsonModelWriter obj's underlying member method code with example usage: obj.write(data, metadata) without return types