code: def test_sort_structs() -> None:
      assert pl.DataFrame(
          {"sex": ["male", "female", "female"], "age": [22, 38, 26]}
      ).select(pl.struct(["sex", "age"]).sort()).unnest("sex").to_dict(
          as_series=False
      ) == {
          "sex": ["female", "female", "male"],
          "age": [26, 38, 22],
      }
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from datetime import datetime, time
  from typing import TYPE_CHECKING
  import pandas
  import pyarrow
  import pytest
  import polars
  import polars.selectors
  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_structs() without return types