code: def test_python_slicing_data_frame() -> None:
      df = pl.DataFrame({"a": [1, 2, 3], "b": ["a", "b", "c"]})
      expected = pl.DataFrame({"a": [2, 3], "b": ["b", "c"]})
      for slice_params in (
          [1, 10],  # slice > len(df)
          [1, 2],  # slice == len(df)
          [1],  # optional len
      ):
          assert_frame_equal(df.slice(*slice_params), expected)
  
      for py_slice in (
          slice(1, 2),
          slice(0, 2, 2),
          slice(3, -3, -1),
          slice(1, None, -2),
          slice(-1, -3, -1),
          slice(-3, None, -3),
      ):
          # confirm frame slice matches python slice
          assert df[py_slice].rows() == df.rows()[py_slice]
  
file_path: polars/py-polars/tests/unit/operations/test_slice.py
imports: import polars
  from polars.testing import assert_frame_equal, assert_frame_not_equal
label_desc: Use image node_id 2 for calling a global function with example usage: test_python_slicing_data_frame() without return types