code: def write_metadata(self, metadata: Dict):
      self.artifact.metadata.metadata = metadata
  
imports: import json
  import logging
  import typing
  from pathlib import Path
  from typing import Dict, Optional, Union
  import requests
  from fate.components.core.essential import JsonMetricArtifactType
  from .._base_type import URI, ArtifactDescribe, Metadata, MetricOutputMetadata, _ArtifactType, _ArtifactTypeWriter
label_desc: Use image node_id 2 for calling the JsonMetricRestfulWriter obj's underlying member method code with example usage: obj.write_metadata(metadata) without return types