code: def test_struct_list_head_tail() -> None:
      assert pl.DataFrame(
          {
              "list_of_struct": [
                  [{"a": 1, "b": 4}, {"a": 3, "b": 6}],
                  [
                      {"a": 10, "b": 40},
                      {"a": 20, "b": 50},
                      {"a": 30, "b": 60},
                  ],
              ]
          }
      ).with_columns(
          [
              pl.col("list_of_struct").list.head(1).alias("head"),
              pl.col("list_of_struct").list.tail(1).alias("tail"),
          ]
      ).to_dict(
          as_series=False
      ) == {
          "list_of_struct": [
              [{"a": 1, "b": 4}, {"a": 3, "b": 6}],
              [
                  {"a": 10, "b": 40},
                  {"a": 20, "b": 50},
                  {"a": 30, "b": 60},
              ],
          ],
          "head": [[{"a": 1, "b": 4}], [{"a": 10, "b": 40}]],
          "tail": [[{"a": 3, "b": 6}], [{"a": 30, "b": 60}]],
      }
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from datetime import datetime, time
  from typing import TYPE_CHECKING
  import pandas
  import pyarrow
  import pytest
  import polars
  import polars.selectors
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 17 for calling a global function with example usage: test_struct_list_head_tail() without return types