code: def test_datetime_range() -> None:
      result = pl.datetime_range(
          date(1985, 1, 1),
          date(2015, 7, 1),
          timedelta(days=1, hours=12),
          eager=True,
      )
      assert len(result) == 7426
      assert result.dt[0] == datetime(1985, 1, 1)
      assert result.dt[1] == datetime(1985, 1, 2, 12, 0)
      assert result.dt[2] == datetime(1985, 1, 4, 0, 0)
      assert result.dt[-1] == datetime(2015, 6, 30, 12, 0)
  
      for time_unit in DTYPE_TEMPORAL_UNITS:
          rng = pl.datetime_range(
              datetime(2020, 1, 1),
              date(2020, 1, 2),
              "2h",
              time_unit=time_unit,
              eager=True,
          )
          assert rng.dtype.time_unit == time_unit  # type: ignore[attr-defined]
          assert rng.shape == (13,)
          assert rng.dt[0] == datetime(2020, 1, 1)
          assert rng.dt[-1] == datetime(2020, 1, 2)
  
      result = pl.datetime_range(
          date(2022, 1, 1), date(2022, 1, 2), "1h30m", eager=True
      )
      assert list(result) == [
          datetime(2022, 1, 1, 0, 0),
          datetime(2022, 1, 1, 1, 30),
          datetime(2022, 1, 1, 3, 0),
          datetime(2022, 1, 1, 4, 30),
          datetime(2022, 1, 1, 6, 0),
          datetime(2022, 1, 1, 7, 30),
          datetime(2022, 1, 1, 9, 0),
          datetime(2022, 1, 1, 10, 30),
          datetime(2022, 1, 1, 12, 0),
          datetime(2022, 1, 1, 13, 30),
          datetime(2022, 1, 1, 15, 0),
          datetime(2022, 1, 1, 16, 30),
          datetime(2022, 1, 1, 18, 0),
          datetime(2022, 1, 1, 19, 30),
          datetime(2022, 1, 1, 21, 0),
          datetime(2022, 1, 1, 22, 30),
          datetime(2022, 1, 2, 0, 0),
      ]
  
      result = pl.datetime_range(
          datetime(2022, 1, 1),
          datetime(2022, 1, 1, 0, 1),
          "987456321ns",
          eager=True,
      )
      assert len(result) == 61
      assert result.dtype.time_unit == "ns"  # type: ignore[attr-defined]
      assert result.dt.second()[-1] == 59
      assert (
          result.cast(pl.String)[-1] == "2022-01-01 00:00:59.247379260"
      )
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.datatypes import DTYPE_TEMPORAL_UNITS
  from polars.exceptions import ComputeError, TimeZoneAwareConstructorWarning
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 1 for calling a global function with example usage: test_datetime_range() without return types