code: def test_is_last_distinct() -> None:
      # numeric
      s = pl.Series([1, 1, None, 2, None, 3, 3])
      expected = [False, True, False, True, True, False, True]
      assert s.is_last_distinct().to_list() == expected
      # str
      s = pl.Series(["x", "x", None, "y", None, "z", "z"])
      expected = [False, True, False, True, True, False, True]
      assert s.is_last_distinct().to_list() == expected
      # boolean
      s = pl.Series([True, True, None, False, None, False, False])
      expected = [False, True, False, False, True, False, True]
      assert s.is_last_distinct().to_list() == expected
      # struct
      s = pl.Series(
          [
              {"x": 1, "y": 2},
              {"x": 1, "y": 2},
              None,
              {"x": 2, "y": 1},
              None,
              {"x": 3, "y": 2},
              {"x": 3, "y": 2},
          ]
      )
      expected = [False, True, False, True, True, False, True]
      assert s.is_last_distinct().to_list() == expected
      # list
      s = pl.Series(
          [[1, 2], [1, 2], None, [2, 3], None, [3, 4], [3, 4]]
      )
      expected = [False, True, False, True, True, False, True]
      assert s.is_last_distinct().to_list() == expected
  
file_path: polars/py-polars/tests/unit/operations/test_is_first_last_distinct.py
imports: import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 6 for calling a global function with example usage: test_is_last_distinct() without return types