code: def test_filter_aggregation_any() -> None:
      df = pl.DataFrame(
          {
              "id": [1, 2, 3, 4],
              "group": [1, 2, 1, 1],
              "pred_a": [False, True, False, False],
              "pred_b": [False, False, True, True],
          }
      )
  
      result = (
          df.group_by("group")
          .agg(
              pl.any_horizontal("pred_a", "pred_b").alias("any"),
              pl.col("id")
              .filter(pl.any_horizontal("pred_a", "pred_b"))
              .alias("filtered"),
          )
          .sort("group")
      )
  
      assert result.to_dict(as_series=False) == {
          "group": [1, 2],
          "any": [[False, True, True], [True]],
          "filtered": [[3, 4], [2]],
      }
  
file_path: polars/py-polars/tests/unit/operations/test_filter.py
imports: from datetime import datetime
  import pytest
  import polars
  from polars import PolarsDataType
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 7 for calling a global function with example usage: test_filter_aggregation_any() without return types