class_docstr: Base Handler for CLI.
  
  Attributes:
    flags_dict: A dictionary with flags provided in a command.
docstr: Pretty-print the table (like tabluate library does).
code: def _format_table(
      self, header: Collection[Any], data: Collection[Collection[Any]]
  ):
      """Pretty-print the table (like tabluate library does)."""
  
      def _format_as_strings(items):
          return [f" {item} " for item in items]
  
      header = _format_as_strings(header)
      data = [_format_as_strings(row) for row in data]
  
      max_widths = [len(s) for s in header]
      for row in data:
          max_widths = [
              max(c_max, len(item))
              for c_max, item in zip(max_widths, row)
          ]
  
      def _make_line(record, widths, sep="|", fill=" "):
          return (
              sep
              + sep.join(
                  item.ljust(width, fill)
                  for item, width in zip(record, widths)
              )
              + sep
              + "\n"
          )
  
      empty_data = [""] * len(header)  # empty data for horizontal line
      double_separator = _make_line(empty_data, max_widths, "+", "=")
      single_separator = _make_line(empty_data, max_widths, "+", "-")
  
      result = double_separator
      result += _make_line(header, max_widths)
      result += double_separator
      result += single_separator.join(
          _make_line(record, max_widths) for record in data
      )
      result += double_separator
  
      return result
  
imports: import abc
  from importlib import machinery
  from importlib import util
  import json
  import os
  import subprocess
  import sys
  from typing import Any, Collection, Dict, List, Optional
  import click
  from tfx.dsl.components.base import base_driver
  from tfx.dsl.io import fileio
  from tfx.tools.cli import labels
  from tfx.tools.cli.handler import dag_runner_patcher
  from tfx.utils import io_utils
label_desc: Use image node_id 17 for calling the BaseHandler obj's underlying member method code with example usage: obj._format_table(header, data) and returns: result, unknown, unknown