code: def test_pivot_temporal_logical_types() -> None:
      date_lst = [datetime(_, 1, 1) for _ in range(1960, 1980)]
  
      df = pl.DataFrame(
          {
              "idx": date_lst[-3:] + date_lst[0:5],
              "foo": ["a"] * 3 + ["b"] * 5,
              "value": [0] * 8,
          }
      )
      assert df.pivot(
          index="idx",
          columns="foo",
          values="value",
          aggregate_function=None,
      ).to_dict(as_series=False) == {
          "idx": [
              datetime(1977, 1, 1, 0, 0),
              datetime(1978, 1, 1, 0, 0),
              datetime(1979, 1, 1, 0, 0),
              datetime(1960, 1, 1, 0, 0),
              datetime(1961, 1, 1, 0, 0),
              datetime(1962, 1, 1, 0, 0),
              datetime(1963, 1, 1, 0, 0),
              datetime(1964, 1, 1, 0, 0),
          ],
          "a": [0, 0, 0, None, None, None, None, None],
          "b": [None, None, None, 0, 0, 0, 0, 0],
      }
  
imports: from __future__ import annotations
  from datetime import date, datetime, timedelta
  from typing import TYPE_CHECKING, Any
  import pytest
  import polars
  import polars.selectors
  from polars.exceptions import ComputeError
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 11 for calling a global function with example usage: test_pivot_temporal_logical_types() without return types