code: def test_array_any_all() -> None:
      s = pl.Series(
          [
              [True, True],
              [False, True],
              [False, False],
              [None, None],
              None,
          ],
          dtype=pl.Array(pl.Boolean, 2),
      )
  
      expected_any = pl.Series([True, True, False, False, None])
      assert_series_equal(s.arr.any(), expected_any)
  
      expected_all = pl.Series([True, False, False, True, None])
      assert_series_equal(s.arr.all(), expected_all)
  
      s = pl.Series(
          [[1, 2], [3, 4], [5, 6]], dtype=pl.Array(pl.Int64, 2)
      )
      with pytest.raises(
          ComputeError, match="expected boolean elements in array"
      ):
          s.arr.any()
      with pytest.raises(
          ComputeError, match="expected boolean elements in array"
      ):
          s.arr.all()
  
file_path: polars/py-polars/tests/unit/namespaces/array/test_array.py
imports: import numpy
  import pytest
  import polars
  from polars import ComputeError
  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_array_any_all() without return types