code: def test_excel_round_trip(write_params: dict[str, Any]) -> None:
      df = pl.DataFrame(
          {
              "dtm": [
                  date(2023, 1, 1),
                  date(2023, 1, 2),
                  date(2023, 1, 3),
              ],
              "str": ["xxx", "yyy", "xxx"],
              "val": [100.5, 55.0, -99.5],
          }
      )
      header_opts = (
          {}
          if write_params.get("include_header", True)
          else {
              "has_header": False,
              "new_columns": ["dtm", "str", "val"],
          }
      )
      fmt_strptime = "%Y-%m-%d"
      if (
          write_params.get("dtype_formats", {}).get(pl.Date)
          == "dd-mm-yyyy"
      ):
          fmt_strptime = "%d-%m-%Y"
  
      # write to an xlsx with polars, using various parameters...
      xls = BytesIO()
      _wb = df.write_excel(
          workbook=xls, worksheet="data", **write_params
      )
  
      # ...and read it back again:
      xldf = pl.read_excel(
          xls,
          sheet_name="data",
          read_csv_options=header_opts,
      )[:3]
      xldf = xldf.select(xldf.columns[:3]).with_columns(
          pl.col("dtm").str.strptime(pl.Date, fmt_strptime)
      )
      assert_frame_equal(df, xldf)
  
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 17 for calling a global function with example usage: test_excel_round_trip(write_params) without return types