code: def console_width(
      table: "Table", console: "RichConsole", val: int
  ) -> Iterator[None]:
      # NOTE: rich does not have native support for unlimited width
      # via pager. we override rich table compression by setting
      # console width to the full width of the table
  
      console_options = console.options
      original = console_options.max_width
      con_width = console._width
  
      try:
          console_options.max_width = val
          measurement = table.__rich_measure__(console, console_options)
          console._width = measurement.maximum
  
          yield
      finally:
          console_options.max_width = original
          console._width = con_width
  
file_path: dvc/dvc/ui/table.py
imports: from collections import abc
  from contextlib import ExitStack, contextmanager
  from itertools import zip_longest
  from typing import TYPE_CHECKING, Dict, Iterator, Optional, Sequence, Union
  from dvc.types import DictStrAny
label_desc: Use image node_id 2 for calling a global function with example usage: console_width(table, console, val) without return types