code: def test_sort_by_11653() -> None:
      df = pl.DataFrame(
          {
              "id": [0, 0, 0, 0, 0, 1],
              "weights": [1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
              "other": [0.8, 0.4, 0.5, 0.6, 0.7, 0.8],
          }
      )
  
      assert df.group_by("id").agg(
          (pl.col("weights") / pl.col("weights").sum())
          .sort_by("other")
          .sum()
          .alias("sort_by"),
      ).sort("id").to_dict(as_series=False) == {
          "id": [0, 1],
          "sort_by": [1.0, 1.0],
      }
  
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 40 for calling a global function with example usage: test_sort_by_11653() without return types