def deep_del(data, fn):
result = {}<EOL>for k, v in data.iteritems():<EOL><INDENT>if not fn(v):<EOL><INDENT>if isinstance(v, dict):<EOL><INDENT>result[k] = deep_del(v, fn)<EOL><DEDENT>else:<EOL><INDENT>result[k] = v<EOL><DEDENT><DEDENT><DEDENT>return result<EOL>
Create dict copy with removed items.

    Recursively remove items where fn(value) is True.

    Returns:
        dict: New dict with matching items removed.