'Checks if a volume passes a backend\'s filter function.
Returns a tuple in the format (filter_passing, filter_invalid).
Both values are booleans.'

def _check_filter_function(self, stats):

    if (stats['filter_function'] is None):
        LOG.debug('Filter    function    not    set    ::    passing    backend')
        return True
    try:
        filter_result = self._run_evaluator(stats['filter_function'], stats)
    except Exception as ex:
        LOG.warning("Error    in    filtering    function    '%(function)s'    :    '%(error)s'    ::    failing    backend", {'function': stats['filter_function'], 'error': ex})
        return False
    return filter_result
