Helper function to remove items from an iterable with falsey value.
    Removes ``None``, ``{}`` and ``[]``, 0, '' (but does not remove ``False``).
    Recurses into sub-iterables if ``recurse`` is set to ``True``.

    :param dict/list data: Source iterable (dict, OrderedDict, list, set, ...) to process.
    :param int recurse_depth: Recurse this many levels into values that are dicts
        or lists to also process those. Default: 0 (do not recurse)
    :param list ignore_types: Contains types that can be falsey but must not
        be filtered. Default: Only booleans are not filtered.

    :return type(data)

    .. version-added:: Neon

def filter_falsey(data, recurse_depth=None, ignore_types=()):
    '''
    Helper function to remove items from an iterable with falsey value.
    Removes ``None``, ``{}`` and ``[]``, 0, '' (but does not remove ``False``).
    Recurses into sub-iterables if ``recurse`` is set to ``True``.

    :param dict/list data: Source iterable (dict, OrderedDict, list, set, ...) to process.
    :param int recurse_depth: Recurse this many levels into values that are dicts
        or lists to also process those. Default: 0 (do not recurse)
    :param list ignore_types: Contains types that can be falsey but must not
        be filtered. Default: Only booleans are not filtered.

    :return type(data)

    .. version-added:: Neon
    '''
    filter_element = (
        functools.partial(filter_falsey,
                          recurse_depth=recurse_depth-1,
                          ignore_types=ignore_types)
        if recurse_depth else lambda x: x
    )

    if isinstance(data, dict):
        processed_elements = [(key, filter_element(value)) for key, value in six.iteritems(data)]
        return type(data)([
            (key, value)
            for key, value in processed_elements
            if _is_not_considered_falsey(value, ignore_types=ignore_types)
        ])
    elif hasattr(data, '__iter__') and not isinstance(data, six.string_types):
        processed_elements = (filter_element(value) for value in data)
        return type(data)([
            value for value in processed_elements
            if _is_not_considered_falsey(value, ignore_types=ignore_types)
        ])
    return data