code: def make_widths_table() -> List[Tuple[int, int, int]]:
      table: List[Tuple[int, int, int]] = []
      append = table.append
  
      make_table_task = progress.add_task("Calculating table...")
  
      widths = (
          (codepoint, wcwidth(chr(codepoint)))
          for codepoint in range(0, sys.maxunicode + 1)
      )
  
      _widths = [
          (codepoint, width)
          for codepoint, width in widths
          if width != 1
      ]
      iter_widths = iter(_widths)
  
      endpoint, group_cell_size = next(iter_widths)
      start_codepoint = end_codepoint = endpoint
      for codepoint, cell_size in progress.track(
          iter_widths, task_id=make_table_task, total=len(_widths) - 1
      ):
          if (
              cell_size != group_cell_size
              or codepoint != end_codepoint + 1
          ):
              append((start_codepoint, end_codepoint, group_cell_size))
              start_codepoint = end_codepoint = codepoint
              group_cell_size = cell_size
          else:
              end_codepoint = codepoint
      append((start_codepoint, end_codepoint, group_cell_size))
      return table
  
file_path: rich/tools/make_terminal_widths.py
imports: import subprocess
  from typing import List, Tuple
  import sys
  from rich.progress import Progress
  from wcwidth import wcwidth
label_desc: Use image node_id 1 for calling a global function with example usage: make_widths_table() and returns: table