code: def make_formatter(name: str) -> Callable[[TableData], str]:
      assert name in TABLE_FORMAT_OPTIONS, f"unknown format: {name}"
  
      if name == "json":
          return lambda table_data: json.dumps(table_data, indent=2)
      if name == "yaml":
          return yaml.dump
      if name == "csv":
          return lambda table_data: separated_format(table_data, ",")
  
      assert (
          name in tabulate.tabulate_formats
      ), f"unknown tabulate format {name}"
      return lambda table_data: table_format(table_data, name)
  
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 6 for calling a global function with example usage: make_formatter(name) and returns: function, function, yaml, function