code: def test_reduction_imperatives_booleans():
      """Checks that any/all reduction works in all frameworks"""
      x_np = numpy.asarray(
          [(bit_count(x) % 2) == 0 for x in range(2**6)]
      ).reshape([2] * 6)
      for backend in imp_op_backends:
          if backend.framework_name == "chainer":
              continue  # no support for bools
          print("Reduction any/all tests for ", backend.framework_name)
  
          for axis in range(6):
              expected_result_any = numpy.any(
                  x_np, axis=axis, keepdims=True
              )
              expected_result_all = numpy.all(
                  x_np, axis=axis, keepdims=True
              )
              assert not numpy.array_equal(
                  expected_result_any, expected_result_all
              )
  
              axes = list("abcdef")
              axes_in = list(axes)
              axes_out = list(axes)
              axes_out[axis] = "1"
              pattern = (
                  (" ".join(axes_in)) + " -> " + (" ".join(axes_out))
              )
  
              res_any = reduce(
                  backend.from_numpy(x_np), pattern, reduction="any"
              )
              res_all = reduce(
                  backend.from_numpy(x_np), pattern, reduction="all"
              )
  
              assert numpy.array_equal(
                  expected_result_any, backend.to_numpy(res_any)
              )
              assert numpy.array_equal(
                  expected_result_all, backend.to_numpy(res_all)
              )
  
          # expected result: any/all
          expected_result_any = numpy.any(
              x_np, axis=(0, 1), keepdims=True
          )
          expected_result_all = numpy.all(
              x_np, axis=(0, 1), keepdims=True
          )
          pattern = "a b ... -> 1 1 ..."
          res_any = reduce(
              backend.from_numpy(x_np), pattern, reduction="any"
          )
          res_all = reduce(
              backend.from_numpy(x_np), pattern, reduction="all"
          )
          assert numpy.array_equal(
              expected_result_any, backend.to_numpy(res_any)
          )
          assert numpy.array_equal(
              expected_result_all, backend.to_numpy(res_all)
          )
  
imports: import itertools
  import numpy
  import pytest
  from einops import EinopsError
  from einops.einops import rearrange, reduce, repeat, _enumerate_directions
  from .None import collect_test_backends, is_backend_tested, FLOAT_REDUCTIONS
label_desc: Use image node_id 27 for calling a global function with example usage: test_reduction_imperatives_booleans() without return types