def dedupe_all_lists(obj, exclude_keys=()):
squared_dedupe_len = <NUM_LIT:10><EOL>if isinstance(obj, dict):<EOL><INDENT>new_obj = {}<EOL>for key, value in obj.items():<EOL><INDENT>if key in exclude_keys:<EOL><INDENT>new_obj[key] = value<EOL><DEDENT>else:<EOL><INDENT>new_obj[key] = dedupe_all_lists(value)<EOL><DEDENT><DEDENT>return new_obj<EOL><DEDENT>elif isinstance(obj, (list, tuple, set)):<EOL><INDENT>new_elements = [dedupe_all_lists(v) for v in obj]<EOL>if len(new_elements) < squared_dedupe_len:<EOL><INDENT>new_obj = dedupe_list(new_elements)<EOL><DEDENT>else:<EOL><INDENT>new_obj = dedupe_list_of_dicts(new_elements)<EOL><DEDENT>return type(obj)(new_obj)<EOL><DEDENT>else:<EOL><INDENT>return obj<EOL><DEDENT>
Recursively remove duplucates from all lists.

    Args:
        obj: collection to deduplicate
        exclude_keys (Container[str]): key names to ignore for deduplication