code: def test_sort_by_struct() -> None:
      df = (
          pl.Series([{"a": 300}, {"a": 20}, {"a": 55}])
          .to_frame("st")
          .with_row_count()
      )
      assert df.sort("st").to_dict(as_series=False) == {
          "row_nr": [1, 2, 0],
          "st": [{"a": 20}, {"a": 55}, {"a": 300}],
      }
  
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 28 for calling a global function with example usage: test_sort_by_struct() without return types