code: def test_sort_nans_3740() -> None:
      df = pl.DataFrame(
          {
              "key": [1, 2, 3, 4, 5],
              "val": [
                  0.0,
                  None,
                  float("nan"),
                  float("-inf"),
                  float("inf"),
              ],
          }
      )
      assert df.sort("val")["key"].to_list() == [2, 4, 1, 5, 3]
  
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 6 for calling a global function with example usage: test_sort_nans_3740() without return types