<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def filter_bool(n: Node, query: str) -> bool: """ Filter and ensure that the returned value is of type bool. """

    return _scalariter2item(n, query, bool)