code: def test_sorted_flag_unset_by_arithmetic_4937() -> None:
      df = pl.DataFrame(
          {
              "ts": [1, 1, 1, 0, 1],
              "price": [3.3, 3.0, 3.5, 3.6, 3.7],
              "mask": [1, 1, 1, 1, 0],
          }
      )
  
      assert df.sort("price").group_by("ts").agg(
          [
              (pl.col("price") * pl.col("mask")).max().alias("pmax"),
              (pl.col("price") * pl.col("mask")).min().alias("pmin"),
          ]
      ).sort("ts").to_dict(as_series=False) == {
          "ts": [0, 1],
          "pmax": [3.6, 3.5],
          "pmin": [3.6, 0.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 14 for calling a global function with example usage: test_sorted_flag_unset_by_arithmetic_4937() without return types