code: def test_mask_with_boolean(index):
      ser = Series(range(3))
      idx = Categorical([True, False, True])
      if index:
          idx = CategoricalIndex(idx)
  
      assert com.is_bool_indexer(idx)
      result = ser[idx]
      expected = ser[idx.astype("object")]
      tm.assert_series_equal(result, expected)
  
imports: import math
  import numpy
  import pytest
  from pandas import NA, Categorical, CategoricalIndex, Index, Interval, IntervalIndex, NaT, PeriodIndex, Series, Timedelta, Timestamp
  import pandas._testing
  import pandas.core.common
label_desc: Use image node_id 1 for calling a global function with example usage: test_mask_with_boolean(index) without return types