code: def test_unique_order() -> None:
      df = pl.DataFrame({"a": [1, 2, 1]}).with_row_count()
      assert df.unique(
          keep="last", subset="a", maintain_order=True
      ).to_dict(as_series=False) == {
          "row_nr": [1, 2],
          "a": [2, 1],
      }
      assert df.unique(
          keep="first", subset="a", maintain_order=True
      ).to_dict(as_series=False) == {
          "row_nr": [0, 1],
          "a": [1, 2],
      }
  
imports: from __future__ import annotations
  from collections import OrderedDict
  from datetime import datetime, timedelta
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 15 for calling a global function with example usage: test_unique_order() without return types