code: def table(header, data, title, align="R"):
      data_size = len(data)
      column_size = len(header)
      column_length = [len(str(ele)) + 1 for ele in header]
      for row_idx in range(data_size):
          data_tuple = data[row_idx]
          ele_size = len(data_tuple)
          assert ele_size == column_size
          for i in range(ele_size):
              column_length[i] = max(
                  column_length[i], len(str(data_tuple[i])) + 1
              )
  
      table_column_length = sum(column_length) + column_size + 1
      dash_line = "-" * table_column_length + "\n"
      header_line = "=" * table_column_length + "\n"
      output = ""
      output += dash_line
      output += str(title).center(table_column_length) + "\n"
      output += dash_line
      output += (
          "|"
          + "|".join(
              [
                  str(header[i]).center(column_length[i])
                  for i in range(column_size)
              ]
          )
          + "|\n"
      )
      output += header_line
  
      for data_tuple in data:
          ele_size = len(data_tuple)
          row_list = []
          for i in range(ele_size):
              if align == "R":
                  row_list.append(
                      str(data_tuple[i]).rjust(column_length[i])
                  )
              elif align == "L":
                  row_list.append(
                      str(data_tuple[i]).ljust(column_length[i])
                  )
              elif align == "C":
                  row_list.append(
                      str(data_tuple[i]).center(column_length[i])
                  )
          output += "|" + "|".join(row_list) + "|\n" + dash_line
      return output
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import hashlib
  import filelock
  import errno
  import os
  import sys
  import shutil
  import traceback
label_desc: Use image node_id 1 for calling the StringFormatter obj's underlying member method code with example usage: obj.table(header, data, title, align) and returns: output