code: def test_duration_time_units(
      time_unit: TimeUnit, expected: timedelta
  ) -> None:
      result = pl.LazyFrame().select(
          pl.duration(
              days=1,
              minutes=2,
              seconds=3,
              milliseconds=4,
              microseconds=5,
              nanoseconds=6,
              time_unit=time_unit,
          )
      )
      assert result.schema["duration"] == pl.Duration(time_unit)
      assert result.collect()["duration"].item() == expected
      if time_unit == "ns":
          assert (
              result.collect()["duration"].dt.total_nanoseconds().item()
              == 86523004005006
          )
  
file_path: polars/py-polars/tests/unit/functions/as_datatype/test_duration.py
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING
  import pytest
  import polars
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_duration_time_units(time_unit, expected) without return types