code: def to_protobuf(
      data: "ColumnOrName",
      messageName: str,
      descFilePath: Optional[str] = None,
      options: Optional[Dict[str, str]] = None,
      binaryDescriptorSet: Optional[bytes] = None,
  ) -> Column:
      binary_proto = None
      if binaryDescriptorSet is not None:
          binary_proto = binaryDescriptorSet
      elif descFilePath is not None:
          binary_proto = _read_descriptor_set_file(descFilePath)
  
      # TODO: simplify the code when _invoke_function() supports None as input.
      if binary_proto is not None:
          if options is None:
              return _invoke_function(
                  "to_protobuf",
                  _to_col(data),
                  lit(messageName),
                  lit(binary_proto),
              )
          else:
              return _invoke_function(
                  "to_protobuf",
                  _to_col(data),
                  lit(messageName),
                  lit(binary_proto),
                  _options_to_col(options),
              )
      else:
          if options is None:
              return _invoke_function(
                  "to_protobuf", _to_col(data), lit(messageName)
              )
          else:
              return _invoke_function(
                  "to_protobuf",
                  _to_col(data),
                  lit(messageName),
                  _options_to_col(options),
              )
  
file_path: spark/python/pyspark/sql/connect/protobuf/functions.py
imports: from pyspark.sql.connect.utils import check_dependencies
  from typing import Dict, Optional, TYPE_CHECKING
  from pyspark.sql.protobuf import functions
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.functions.builtin import _invoke_function, _to_col, _options_to_col, lit
label_desc: Use image node_id 2 for calling a global function with example usage: to_protobuf(data, messageName, descFilePath, options, binaryDescriptorSet) and returns: _invoke_function, _invoke_function, _invoke_function, _invoke_function