code: def convert_metadata_to_json(pm: ParameterMetadata) -> Dict[str, Any]:
      """Converts a ParameterMetadata dict to a normal JSON dict.
  
      NOTE: Without the json.loads call, to_json() returns
      a string repr that is improperly parsed.
      """
      if not pm:
          return ParameterMetadata().to_json_dict()
      return pm.to_json_dict()
  
file_path: ludwig/ludwig/schema/metadata/parameter_metadata.py
imports: import json
  from dataclasses import dataclass
  from enum import Enum
  from typing import Any, Dict, List, Optional, Union
  from dataclasses_json import dataclass_json
  from ludwig.api_annotations import DeveloperAPI
  from ludwig.utils.misc_utils import memoized_method
label_desc: Use image node_id 1 for calling a global function with example usage: convert_metadata_to_json(pm) and returns: pm, ParameterMetadata