code: def test_set_tbl_formats() -> None:
      df = pl.DataFrame(
          {
              "foo": [1, 2, 3],
              "bar": [6.0, 7.0, 8.0],
              "ham": ["a", "b", "c"],
          }
      )
      pl.Config().set_tbl_formatting("ASCII_MARKDOWN")
      assert str(df) == (
          "shape: (3, 3)\n"
          "| foo | bar | ham |\n"
          "| --- | --- | --- |\n"
          "| i64 | f64 | str |\n"
          "|-----|-----|-----|\n"
          "| 1   | 6.0 | a   |\n"
          "| 2   | 7.0 | b   |\n"
          "| 3   | 8.0 | c   |"
      )
  
      pl.Config().set_tbl_formatting("ASCII_BORDERS_ONLY_CONDENSED")
      with pl.Config(tbl_hide_dtype_separator=True):
          assert str(df) == (
              "shape: (3, 3)\n"
              "+-----------------+\n"
              "| foo   bar   ham |\n"
              "| i64   f64   str |\n"
              "+=================+\n"
              "| 1     6.0   a   |\n"
              "| 2     7.0   b   |\n"
              "| 3     8.0   c   |\n"
              "+-----------------+"
          )
  
      # temporarily scope "nothing" style, with no data types
      with pl.Config(
          tbl_formatting="NOTHING",
          tbl_hide_column_data_types=True,
      ):
          assert str(df) == (
              "shape: (3, 3)\n"
              " foo  bar  ham \n"
              " 1    6.0  a   \n"
              " 2    7.0  b   \n"
              " 3    8.0  c   "
          )
  
      # after scope, expect previous style
      assert str(df) == (
          "shape: (3, 3)\n"
          "+-----------------+\n"
          "| foo   bar   ham |\n"
          "| ---   ---   --- |\n"
          "| i64   f64   str |\n"
          "+=================+\n"
          "| 1     6.0   a   |\n"
          "| 2     7.0   b   |\n"
          "| 3     8.0   c   |\n"
          "+-----------------+"
      )
  
      # invalid style
      with pytest.raises(
          ValueError, match="invalid table format name: 'NOPE'"
      ):
          pl.Config().set_tbl_formatting("NOPE")
  
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 7 for calling a global function with example usage: test_set_tbl_formats() without return types