code: def table_format(table_data: TableData, tablefmt: str) -> str:
      return tabulate.tabulate(
          table_data, headers="keys", tablefmt=tablefmt
      )
  
imports: import json
  from enum import Enum
  import yaml
  import csv
  from typing import Any, List, Dict, Callable, Annotated
  import tabulate
  import io
  from typer import Option
label_desc: Use image node_id 5 for calling a global function with example usage: table_format(table_data, tablefmt) and returns: tabulate