code: def write_proto_file(path: Union[str, Path], proto: Message):
      """Writes a message to a proto file, creating any necessary directories.
  
      Args:
        path: The file path to write the proto to.
        proto: The proto to write.
      """
      write_file(path, proto.SerializeToString(), mode="wb")
  
file_path: model-card-toolkit/model_card_toolkit/utils/io_utils.py
imports: import os
  from pathlib import Path
  from typing import Union
  from google.protobuf.message import Message
label_desc: Use image node_id 3 for calling a global function with example usage: write_proto_file(path, proto) without return types