code: def model_deployment_detail(
      model_name, deployment_version_id, model_version_id
  ):
      model = base_controller.model.__dict__
  
      filter = {
          "model_id": model_name,
          "model_version_id": model_version_id,
          "deployment_version_id": deployment_version_id,
      }
      input_keys, prediction_keys, feedback_keys = [], [], []
      data = datmo_monitoring.search_metadata(filter)
  
      if data:
          max_index = 0
          for ind, datum in enumerate(data):
              if datum["feedback"] is not None:
                  max_index = ind
          datum = data[max_index]
          input_keys = list(datum["input"].keys())
          prediction_keys = list(datum["prediction"].keys())
          feedback_keys = (
              list(datum["feedback"].keys())
              if datum["feedback"] is not None
              else []
          )
  
      # Determine the graph directory path and create if not present
      graph_dirpath = os.path.join(
          base_controller.home,
          Config().datmo_directory_name,
          "deployments",
          deployment_version_id,
          model_version_id,
          "graphs",
      )
      if not os.path.exists(graph_dirpath):
          os.makedirs(graph_dirpath)
  
      # Include deployment info
      deployment_info = datmo_monitoring.get_deployment_info(
          deployment_version_id=deployment_version_id
      )
      # Prettify dates
      deployment_info["created_at"] = prettify_datetime(
          deployment_info["created_at"]
      )
      # TODO: replace with proper handling
      deployment_info["endpoints"] = [
          endpoint
          for endpoint in deployment_info["endpoints"]
          if "".join(model_version_id.split("_")) in endpoint
      ]
      deployment_info["service_paths"] = [
          path
          for path in deployment_info["service_paths"]
          if "".join(model_version_id.split("_")) in path
      ]
      # TODO: END
      deployment_info["deployment_version_id"] = deployment_version_id
      deployment_info["model_version_id"] = model_version_id
  
      return render_template(
          "model_deployment_detail.html",
          user=user,
          model=model,
          deployment=deployment_info,
          graph_dirpath=graph_dirpath,
          input_keys=input_keys,
          prediction_keys=prediction_keys,
          feedback_keys=feedback_keys,
      )
  
imports: import os
  import shutil
  import uuid
  import json
  from flask import Flask, url_for
  from flask import render_template, request, jsonify
  import plotly
  from datetime import datetime
  from datmo.config import Config
  from datmo.core.entity.run import Run
  from datmo.core.controller.base import BaseController
  from datmo.core.util.misc_functions import prettify_datetime, printable_object
label_desc: Use image node_id 6 for calling a global function with example usage: model_deployment_detail(model_name, deployment_version_id, model_version_id) and returns: render_template