code: def _stats_to_table(stats, cols):
      levels = set(info["Level"] for info in stats)
      min_level = min(levels)
      num_pad_cols = max(levels) - min_level
      # Assume that the first column is Layer Name
      cols = cols[:1] + [""] * num_pad_cols + cols[1:]
      table = Table(cols)
      for info in stats:
          level = info["Level"]
          row = [info.get(key, "") for key in cols if key != ""]
          # Round float numbers
          for i, ele in enumerate(row):
              if isinstance(ele, float):
                  row[i] = _round(ele)
          rel_level = level - min_level
          row = (
              [""] * rel_level
              + [row[0]]
              + [""] * (num_pad_cols - rel_level)
              + row[1:]
          )
          table.add_row(row)
      return table
  
file_path: PaddleSeg/contrib/PanopticSeg/tools/analyze_model.py
imports: import argparse
  import io
  import sys
  import contextlib
  from collections import OrderedDict
  import paddle
  from paddle.hapi.static_flops import Table
  from paddle.hapi.dynamic_flops import count_parameters, register_hooks, count_io_info
  from paddleseg.utils import get_sys_env, logger, op_flops_funs, utils
  from paddlepanseg.cvlibs import Config, make_default_builder
label_desc: Use image node_id 4 for calling a global function with example usage: _stats_to_table(stats, cols) and returns: table