code: def test_all_any_horizontally() -> None:
      df = pl.DataFrame(
          [
              [False, False, True],
              [False, False, True],
              [True, False, False],
              [False, None, True],
              [None, None, False],
          ],
          schema=["var1", "var2", "var3"],
      )
      result = df.select(
          any=pl.any_horizontal(pl.col("var2"), pl.col("var3")),
          all=pl.all_horizontal(pl.col("var2"), pl.col("var3")),
      )
      expected = pl.DataFrame(
          {
              "any": [True, True, False, True, None],
              "all": [False, False, False, None, False],
          }
      )
      assert_frame_equal(result, expected)
  
      # note: a kwargs filter will use an internal call to all_horizontal
      dfltr = df.lazy().filter(var1=None, var3=False)
      assert dfltr.collect().rows() == [(None, None, False)]
  
      # confirm that we reduce the horizontal filter components
      # (eg: explain does not contain an "all_horizontal" node)
      assert "horizontal" not in dfltr.explain().lower()
  
imports: from __future__ import annotations
  import 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 2 for calling a global function with example usage: test_all_any_horizontally() without return types