code: def _result_msg_type(result: "pb.Result") -> str:
      msg_type = str(result.WhichOneof("result_type"))
      if msg_type == "response":
          response = result.response
          msg_type = str(response.WhichOneof("response_type"))
      return msg_type
  
imports: import datetime
  import logging
  import secrets
  import sys
  import threading
  from typing import TYPE_CHECKING, Optional, cast
label_desc: Use image node_id 3 for calling a global function with example usage: _result_msg_type(result) and returns: msg_type