code: def _bool_arith_check(op, a, b):
      """
      In contrast to numpy, pandas raises an error for certain operations
      with booleans.
      """
      if op in _BOOL_OP_NOT_ALLOWED:
          if is_bool_dtype(a.dtype) and (
              is_bool_dtype(b) or isinstance(b, (bool, np.bool_))
          ):
              op_name = op.__name__.strip("_").lstrip("r")
              raise NotImplementedError(
                  f"operator '{op_name}' not implemented for bool dtypes"
              )
  
imports: from __future__ import annotations
  import datetime
  from functools import partial
  import operator
  from typing import Any
  import numpy
  from pandas._libs import NaT, Timedelta, Timestamp, lib, ops
  from pandas._libs.tslibs import BaseOffset, get_supported_reso, get_unit_from_dtype, is_supported_unit, is_unitless, npy_unit_to_abbrev
  from pandas._typing import ArrayLike, Shape
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike, find_common_type
  from pandas.core.dtypes.common import ensure_object, is_bool_dtype, is_integer_dtype, is_list_like, is_numeric_v_string_like, is_object_dtype, is_scalar
  from pandas.core.dtypes.generic import ABCExtensionArray, ABCIndex, ABCSeries
  from pandas.core.dtypes.missing import isna, notna
  from pandas.core.computation import expressions
  from pandas.core.construction import ensure_wrapped_if_datetimelike
  from pandas.core.ops import missing, roperator
  from pandas.core.ops.dispatch import should_extension_dispatch
  from pandas.core.ops.invalid import invalid_comparison
label_desc: Use image node_id 10 for calling a global function with example usage: _bool_arith_check(op, a, b) without return types