code: def test_excel_write_multiple_tables() -> None:
      from xlsxwriter import Workbook
  
      # note: checks that empty tables don't error on write
      df1 = pl.DataFrame(
          schema={
              "colx": pl.Date,
              "coly": pl.String,
              "colz": pl.Float64,
          }
      )
      df2 = pl.DataFrame(
          schema={
              "colx": pl.Date,
              "coly": pl.String,
              "colz": pl.Float64,
          }
      )
      df3 = pl.DataFrame(
          schema={
              "colx": pl.Date,
              "coly": pl.String,
              "colz": pl.Float64,
          }
      )
      df4 = pl.DataFrame(
          schema={
              "colx": pl.Date,
              "coly": pl.String,
              "colz": pl.Float64,
          }
      )
  
      xls = BytesIO()
      with Workbook(xls) as wb:
          df1.write_excel(
              workbook=wb, worksheet="sheet1", position="A1"
          )
          df2.write_excel(
              workbook=wb, worksheet="sheet1", position="A6"
          )
          df3.write_excel(
              workbook=wb, worksheet="sheet2", position="A1"
          )
  
          # validate integration of externally-added formats
          fmt = wb.add_format({"bg_color": "#ffff00"})
          df4.write_excel(
              workbook=wb,
              worksheet="sheet3",
              position="A1",
              conditional_formats={
                  "colz": {
                      "type": "formula",
                      "criteria": "=C2=B2",
                      "format": fmt,
                  }
              },
          )
  
      table_names: set[str] = set()
      for sheet in ("sheet1", "sheet2", "sheet3"):
          table_names.update(
              tbl["name"]
              for tbl in wb.get_worksheet_by_name(sheet).tables
          )
      assert table_names == {f"Frame{n}" for n in range(4)}
      assert pl.read_excel(xls, sheet_name="sheet3").rows() == []
  
imports: from __future__ import annotations
  import warnings
  from collections import OrderedDict
  from datetime import date, datetime
  from io import BytesIO
  from typing import TYPE_CHECKING, Any, Callable, Literal
  import pytest
  import polars
  import polars.selectors
  from polars.exceptions import NoDataError, ParameterCollisionError
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_excel_write_multiple_tables() without return types