code: def test_cast_time_units(
      time_unit: TimeUnit,
      date_in_that_unit: list[int],
  ) -> None:
      dates = pl.Series(
          [datetime(2001, 1, 1), datetime(2001, 2, 1, 10, 8, 9)]
      )
  
      assert (
          dates.dt.cast_time_unit(time_unit).cast(int).to_list()
          == date_in_that_unit
      )
  
imports: from __future__ import annotations
  import sys
  from datetime import date, datetime, time, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.datatypes import DTYPE_TEMPORAL_UNITS
  from polars.dependencies import _ZONEINFO_AVAILABLE
  from polars.exceptions import ComputeError, InvalidOperationError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 29 for calling a global function with example usage: test_cast_time_units(time_unit, date_in_that_unit) without return types