code: def get_recorded_durations_table(
      result: Dict[str, Dict[str, float]]
  ) -> str:
      r"""
      Helper function to generate recorded duration time in tabular format
      """
      if len(result) == 0:
          return ""
      sub_dict = next(iter(result.values()))
      if len(sub_dict) == 0:
          return ""
      column_headers = ["Name"] + list(sub_dict.keys())
      row_output = []
      for key in result:
          row = [key] + [
              "{:.3f}".format(x) for x in result[key].values()
          ]
          row_output.append(row)
      tabulate_output = tabulate(
          row_output,
          tablefmt="pipe",
          headers=column_headers,
      )
      return "\n" + tabulate_output
  
imports: import datetime
  import logging
  import os
  from collections import defaultdict
  from contextlib import contextmanager
  from time import perf_counter
  from typing import Any, Dict, Generator, List, Optional, Protocol, runtime_checkable, Sequence, Tuple, TypeVar
  import numpy
  import torch
  import torch.distributed
  from tabulate import tabulate
  from torchtnt.utils.distributed import PGWrapper
label_desc: Use image node_id 12 for calling a global function with example usage: get_recorded_durations_table(result) and returns: unknown, str, str