docstr: Format output response
  Args:
      result (ResponseType): response returned after execution
  
  Returns:
      ResponseType: formatted response output
docstr_tok: ["Format","output","response","Args",":","result","(","ResponseType",")",":","response","returned","after","execution","Returns",":","ResponseType",":","formatted","response","output"]
code: def _format_response(self, result: ResponseType) -> ResponseType:
      """
      Format output response
      Args:
          result (ResponseType): response returned after execution
  
      Returns:
          ResponseType: formatted response output
      """
      if result["type"] == "dataframe":
          df_dict = self.convert_dataframe_to_dict(result["value"])
          return {"type": result["type"], "value": df_dict}
  
      elif result["type"] == "plot":
          with open(result["value"], "rb") as image_file:
              image_data = image_file.read()
          # Encode the image data to Base64
          base64_image = f"data:image/png;base64,{base64.b64encode(image_data).decode()}"
          return {
              "type": result["type"],
              "value": base64_image,
          }
      else:
          return result
  
imports: import base64
  import json
  import os
  import time
  from typing import Any, List, TypedDict, Union
  import uuid
  import requests
  from collections import defaultdict
label_desc: Use image node_id 10 for calling the QueryExecTracker obj's underlying member method code with example usage: obj._format_response(result) and returns: dict, dict, result