code: def test_list_slice() -> None:
      df = pl.DataFrame(
          {
              "lst": [[1, 2, 3, 4], [10, 2, 1]],
              "offset": [1, 2],
              "len": [3, 2],
          }
      )
  
      assert df.select(
          [pl.col("lst").list.slice("offset", "len")]
      ).to_dict(as_series=False) == {"lst": [[2, 3, 4], [1]]}
      assert df.select([pl.col("lst").list.slice("offset", 1)]).to_dict(
          as_series=False
      ) == {"lst": [[2], [1]]}
      assert df.select([pl.col("lst").list.slice(-2, "len")]).to_dict(
          as_series=False
      ) == {"lst": [[3, 4], [2, 1]]}
  
imports: from __future__ import annotations
  from datetime import date, datetime
  import numpy
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 16 for calling a global function with example usage: test_list_slice() without return types