code: def format_data(records: List[Dict[str, Any]]):
      cost_by_service: Dict[str, int] = defaultdict(int)
      compute_cost_breakdown: Dict[str, int] = defaultdict(int)
      cost_by_sku_source: List[Dict[str, Any]] = []
  
      for record in records:
          cost_by_sku_source.append(record)
  
          cost_by_service[record["service_description"]] += record[
              "cost"
          ]
  
          # service.id: service.description -- "6F81-5844-456A": "Compute Engine"
          if record["service_id"] == "6F81-5844-456A":
              assert record["source"] is not None
              compute_cost_breakdown[record["source"]] += record["cost"]
          else:
              assert record["source"] is None
  
      def non_optional_cost_str(cost: int):
          s = cost_str(cost)
          assert s is not None
          return s
  
      str_cost_by_service = sorted(
          [
              {"service": k, "cost": non_optional_cost_str(v)}
              for k, v in cost_by_service.items()
          ],
          key=lambda x: x["cost"],
          reverse=True,
      )
  
      str_compute_cost_breakdown = sorted(
          [
              {"source": k, "cost": non_optional_cost_str(v)}
              for k, v in compute_cost_breakdown.items()
          ],
          key=lambda x: x["cost"],
          reverse=True,
      )
  
      cost_by_sku_source.sort(key=lambda x: x["cost"], reverse=True)
      for record in cost_by_sku_source:
          record["cost"] = cost_str(record["cost"])
  
      return (
          str_cost_by_service,
          str_compute_cost_breakdown,
          cost_by_sku_source,
      )
  
imports: import asyncio
  import calendar
  import datetime
  import json
  import logging
  import os
  from collections import defaultdict, namedtuple
  from contextlib import AsyncExitStack
  from typing import Any, Dict, List
  import aiohttp_session
  import prometheus_client
  from aiohttp import web
  from prometheus_async.aio.web import server_stats
  from gear import AuthServiceAuthenticator, Database, json_response, setup_aiohttp_session, transaction
  from hailtop import aiotools, httpx
  from hailtop.aiocloud import aiogoogle
  from hailtop.config import get_deploy_config
  from hailtop.hail_logging import AccessLogger
  from hailtop.tls import internal_server_ssl_context
  from hailtop.utils import cost_str, parse_timestamp_msecs, periodically_call, retry_long_running, run_if_changed_idempotent, time_msecs, url_basename
  from web_common import render_template, set_message, setup_aiohttp_jinja2, setup_common_static_routes
  from .configuration import HAIL_USE_FULL_QUERY
label_desc: Use image node_id 3 for calling a global function with example usage: format_data(records) and returns: str_cost_by_service,  str_compute_cost_breakdown,  cost_by_sku_source, s