code: def test_set_tbl_width_chars() -> None:
      df = pl.DataFrame(
          {
              "a really long col": [1, 2, 3],
              "b": [
                  "",
                  "this is a string value that will be truncated",
                  None,
              ],
              "this is 10": [4, 5, 6],
          }
      )
      assert max(len(line) for line in str(df).split("\n")) == 70
  
      pl.Config.set_tbl_width_chars(60)
      assert max(len(line) for line in str(df).split("\n")) == 60
  
      # force minimal table size (will hard-wrap everything; "don't try this at home" :p)
      pl.Config.set_tbl_width_chars(0)
      assert max(len(line) for line in str(df).split("\n")) == 19
  
      # this check helps to check that column width bucketing
      # is exact; no extraneous character allocation
      df = pl.DataFrame(
          {
              "A": [1, 2, 3, 4, 5],
              "fruits": [
                  "banana",
                  "banana",
                  "apple",
                  "apple",
                  "banana",
              ],
              "B": [5, 4, 3, 2, 1],
              "cars": ["beetle", "audi", "beetle", "beetle", "beetle"],
          },
          schema_overrides={"A": pl.Int64, "B": pl.Int64},
      ).select(pl.all(), pl.all().name.suffix("_suffix!"))
  
      with pl.Config(tbl_width_chars=87):
          assert max(len(line) for line in str(df).split("\n")) == 87
  
imports: from __future__ import annotations
  import os
  from pathlib import Path
  from typing import Any, Iterator
  import pytest
  import polars
  import polars.polars
  from polars.config import _POLARS_CFG_ENV_VARS
label_desc: Use image node_id 8 for calling a global function with example usage: test_set_tbl_width_chars() without return types