code: def to_simple_filter(bool_or_filter):
      
      if not isinstance(bool_or_filter, (bool, SimpleFilter)):
          raise TypeError('Expecting a bool or a SimpleFilter instance. Got %r' % bool_or_filter)
  
      return {
          True: _always,
          False: _never,
      }.get(bool_or_filter, bool_or_filter)
docs: Accept both booleans and CLIFilters as input and
      turn it into a SimpleFilter.