(domain)
return form_counts
This is used to get (XMLNS, app_id) from submitted forms. The results
    get combined with data from all current app versions which means
    that this is only used to get (XMLNS, app_id) combos from forms submitted
    in the past which no longer have a corresponding form in the app (e.g. form deleted)

    Given that we can cache this for a long period of time under the assumption that
    a user isn't going to submit a form and then delete it from their app immediately.
This is used to get (XMLNS, app_id) from submitted forms. The results
    get combined with data from all current app versions which means
    that this is only used to get (XMLNS, app_id) combos from forms submitted
    in the past which no longer have a corresponding form in the app (e.g. form deleted)
This is used to get ( XMLNS app_id ) from submitted forms . The results get combined with data from all current app versions which means that this is only used to get ( XMLNS app_id ) combos from forms submitted in the past which no longer have a corresponding form in the app ( e . g . form deleted )
def get_all_xmlns_app_id_pairs_submitted_to_in_domain(domain):
    """This is used to get (XMLNS, app_id) from submitted forms. The results
    get combined with data from all current app versions which means
    that this is only used to get (XMLNS, app_id) combos from forms submitted
    in the past which no longer have a corresponding form in the app (e.g. form deleted)

    Given that we can cache this for a long period of time under the assumption that
    a user isn't going to submit a form and then delete it from their app immediately.
    """
    query = (FormES()
             .domain(domain)
             .aggregation(
                 TermsAggregation("app_id", "app_id").aggregation(
                     TermsAggregation("xmlns", "xmlns.exact")))
             .remove_default_filter("has_xmlns")
             .remove_default_filter("has_user")
             .size(0))
    query_result = query.run()
    form_counts = set()
    for app_id, bucket in query_result.aggregations.app_id.buckets_dict.items():
        for sub_bucket in bucket.xmlns.buckets_list:
            xmlns = sub_bucket.key
            form_counts.add((xmlns, app_id))
    return form_counts
def get_all_xmlns_app_id_pairs_submitted_to_in_domain ( domain ) : query = ( FormES ( ) . domain ( domain ) . aggregation ( TermsAggregation ( "app_id" , "app_id" ) . aggregation ( TermsAggregation ( "xmlns" , "xmlns.exact" ) ) ) . remove_default_filter ( "has_xmlns" ) . remove_default_filter ( "has_user" ) . size ( 0 ) ) query_result = query . run ( ) form_counts = set ( ) for app_id , bucket in query_result . aggregations . app_id . buckets_dict . items ( ) : for sub_bucket in bucket . xmlns . buckets_list : xmlns = sub_bucket . key form_counts . add ( ( xmlns , app_id ) ) return form_counts