code: def dict_tab(d, in_row=False):
      try:
          if in_row:
              return tabulate(
                  [(str(k), str(v)) for k, v in d.items()],
                  tablefmt="fancy_grid",
              )
          else:
              return tabulate(
                  (map(str, d.values()),),
                  headers=map(str, d.keys()),
                  tablefmt="fancy_grid",
              )
      except ImportError:
          return repr(d)
  
imports: import asyncio
  import math
  import time
  from collections import defaultdict
  from tabulate import tabulate
label_desc: Use image node_id 2 for calling a global function with example usage: dict_tab(d, in_row) and returns: tabulate, tabulate, repr