code: def pretty_table_printer(dataset_or_ins) -> PrettyTable:
      r"""
      用于在 **fastNLP** 中展示数据的函数::
  
          >>> ins = Instance(field_1=[1, 1, 1], field_2=[2, 2, 2], field_3=["a", "b", "c"])
          +-----------+-----------+-----------------+
          |  field_1  |  field_2  |     field_3     |
          +-----------+-----------+-----------------+
          | [1, 1, 1] | [2, 2, 2] | ['a', 'b', 'c'] |
          +-----------+-----------+-----------------+
  
      :param dataset_or_ins: 要展示的 :class:`~fastNLP.core.DataSet` 或者 :class:`~fastNLP.core.Instance` 实例；
      :return: 根据命令行大小进行自动截断的数据表格；
      """
      x = PrettyTable()
      try:
          sz = os.get_terminal_size()
          column = sz.columns
          row = sz.lines
      except OSError:
          column = 144
          row = 11
  
      if type(dataset_or_ins).__name__ == "DataSet":
          x.field_names = list(dataset_or_ins.field_arrays.keys())
          c_size = len(x.field_names)
          for ins in dataset_or_ins:
              x.add_row(
                  [
                      sub_column(ins[k], column, c_size, k)
                      for k in x.field_names
                  ]
              )
              row -= 1
              if row < 0:
                  x.add_row(["..." for _ in range(c_size)])
                  break
      elif type(dataset_or_ins).__name__ == "Instance":
          x.field_names = list(dataset_or_ins.fields.keys())
          c_size = len(x.field_names)
          x.add_row(
              [
                  sub_column(dataset_or_ins[k], column, c_size, k)
                  for k in x.field_names
              ]
          )
  
      else:
          raise Exception("only accept  DataSet and Instance")
      x.align = "l"
  
      return x
  
imports: import functools
  import inspect
  from inspect import Parameter
  import dataclasses
  from dataclasses import is_dataclass
  from copy import deepcopy
  from collections import defaultdict, OrderedDict
  from typing import Callable, List, Any, Dict, AnyStr, Union, Mapping, Sequence
  from typing import Tuple, Optional
  from time import sleep
  import os
  from contextlib import contextmanager
  from functools import wraps
  from prettytable import PrettyTable
  from pathlib import Path
  from fastNLP.core.log import logger
label_desc: Use image node_id 15 for calling a global function with example usage: pretty_table_printer(dataset_or_ins) and returns: x