code: def test_sort_by_in_over_5499() -> None:
      df = pl.DataFrame(
          {
              "group": [1, 1, 1, 2, 2, 2],
              "idx": pl.arange(0, 6, eager=True),
              "a": [1, 3, 2, 3, 1, 2],
          }
      )
      assert df.select(
          [
              pl.col("idx")
              .sort_by("a")
              .over("group")
              .alias("sorted_1"),
              pl.col("idx")
              .shift(1)
              .sort_by("a")
              .over("group")
              .alias("sorted_2"),
          ]
      ).to_dict(as_series=False) == {
          "sorted_1": [0, 2, 1, 4, 5, 3],
          "sorted_2": [None, 1, 0, 3, 4, None],
      }
  
imports: from __future__ import annotations
  from datetime import date, datetime
  from typing import Any
  import pytest
  import polars
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 20 for calling a global function with example usage: test_sort_by_in_over_5499() without return types