code: def message_to_dict(
      message: "Message",
  ) -> Dict[str, Any]:
      """Convert a protobuf message into a dictionary."""
      from google.protobuf.json_format import MessageToDict
  
      return MessageToDict(message, preserving_proto_field_name=True)
  
file_path: wandb/wandb/sdk/lib/proto_util.py
imports: import json
  from typing import TYPE_CHECKING, Any, Dict, Union
  from wandb.proto import wandb_internal_pb2
label_desc: Use image node_id 6 for calling a global function with example usage: message_to_dict(message) and returns: MessageToDict