code: def print_format_output(dataframe):
      """Prints output of given dataframe to fit into terminal.
  
      Returns:
          table: Final outputted dataframe.
          dropped_cols: Columns dropped due to terminal size.
          empty_cols: Empty columns (dropped on default).
      """
      print_df = pd.DataFrame()
      dropped_cols = []
      empty_cols = []
      # column display priority is based on the info_keys passed in
      for i, col in enumerate(dataframe):
          if dataframe[col].isnull().all():
              # Don't add col to print_df if is fully empty
              empty_cols += [col]
              continue
  
          print_df[col] = dataframe[col]
          test_table = tabulate(
              print_df, headers="keys", tablefmt="psql"
          )
          if str(test_table).index("\n") > TERM_WIDTH:
              # Drop all columns beyond terminal width
              print_df.drop(col, axis=1, inplace=True)
              dropped_cols += list(dataframe.columns)[i:]
              break
  
      table = tabulate(
          print_df, headers="keys", tablefmt="psql", showindex="never"
      )
  
      print(table)
      if dropped_cols:
          click.secho(
              "Dropped columns: {}".format(dropped_cols), fg="yellow"
          )
          click.secho(
              "Please increase your terminal size to view remaining columns."
          )
      if empty_cols:
          click.secho(
              "Empty columns: {}".format(empty_cols), fg="yellow"
          )
  
      return table, dropped_cols, empty_cols
  
imports: from pathlib import Path
  from typing import Optional, List
  import click
  import logging
  import operator
  import os
  import shutil
  import subprocess
  from datetime import datetime
  import pandas
  from pandas.api.types import is_string_dtype, is_numeric_dtype
  from ray.air.constants import EXPR_RESULT_FILE
  from ray.tune.result import DEFAULT_EXPERIMENT_INFO_KEYS, DEFAULT_RESULT_KEYS, CONFIG_PREFIX
  from ray.tune.analysis import ExperimentAnalysis
  from ray.tune import TuneError
  from ray._private.thirdparty.tabulate.tabulate import tabulate
label_desc: Use image node_id 2 for calling a global function with example usage: print_format_output(dataframe) and returns: table,  dropped_cols,  empty_cols