<commit_before>from corehq.apps.es import CaseES, GroupES
from corehq.apps.es import FormES


def get_form_export_base_query(domain, app_id, xmlns, include_errors):
    query = (FormES()
            .domain(domain)
            .app(app_id)
            .xmlns(xmlns)
            .sort("received_on"))
    if include_errors:
        query = query.remove_default_filter("is_xform_instance")
        query = query.doc_type(["xforminstance", "xformarchived", "xformdeprecated", "xformduplicate"])
    return query


def get_case_export_base_query(domain, case_type):<commit_msg>Remove default filter that breaks unknown users export filter<commit_after>from corehq.apps.es import CaseES, GroupES
from corehq.apps.es import FormES


def get_form_export_base_query(domain, app_id, xmlns, include_errors):
    query = (FormES()
            .domain(domain)
            .app(app_id)
            .xmlns(xmlns)
            .sort("received_on")
            .remove_default_filter('has_user'))
    # TODO: Remove has_xmlns default filter too?
    if include_errors:
        query = query.remove_default_filter("is_xform_instance")
        query = query.doc_type(["xforminstance", "xformarchived", "xformdeprecated", "xformduplicate"])
    return query


def get_case_export_base_query(domain, case_type):
{'fraction_non_alphanumeric': 0.10077519379844961, 'fraction_numerical': 0.0, 'mean_word_length': 3.513986013986014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '951682', 'n_tokens_mistral': 408, 'n_tokens_neox': 401, 'n_words': 82}