(domain, user_type, user_filters, count_only=False)
return map(CouchUser.wrap_correctly, iter_docs(CommCareUser.get_db(), user_ids))
Returns users in domain per given filters. If user_filters is empty,
        returns all users in the domain

    args:
        user_type: MOBILE_USER_TYPE or WEB_USER_TYPE
        user_filters: a dict with below structure.
            {'role_id': <Role ID to filter users by>,
             'search_string': <string to search users by username>,
             'location_id': <Location ID to filter users by>}
    kwargs:
        count_only: If True, returns count of search results
Returns users in domain per given filters. If user_filters is empty,
        returns all users in the domain
Returns users in domain per given filters . If user_filters is empty returns all users in the domain
def _get_users_by_filters(domain, user_type, user_filters, count_only=False):
    """
    Returns users in domain per given filters. If user_filters is empty,
        returns all users in the domain

    args:
        user_type: MOBILE_USER_TYPE or WEB_USER_TYPE
        user_filters: a dict with below structure.
            {'role_id': <Role ID to filter users by>,
             'search_string': <string to search users by username>,
             'location_id': <Location ID to filter users by>}
    kwargs:
        count_only: If True, returns count of search results
    """
    if not any([user_filters.get('role_id', None), user_filters.get('search_string', None),
                user_filters.get('location_id', None), count_only]):
        if user_type == MOBILE_USER_TYPE:
            return get_all_commcare_users_by_domain(domain)
        if user_type == WEB_USER_TYPE:
            return get_all_web_users_by_domain(domain)

    query = _get_es_query(domain, user_type, user_filters)

    if count_only:
        return query.count()
    user_ids = query.scroll_ids()
    return map(CouchUser.wrap_correctly, iter_docs(CommCareUser.get_db(), user_ids))
def _get_users_by_filters ( domain , user_type , user_filters , count_only = False ) : if not any ( [ user_filters . get ( 'role_id' , None ) , user_filters . get ( 'search_string' , None ) , user_filters . get ( 'location_id' , None ) , count_only ] ) : if user_type == MOBILE_USER_TYPE : return get_all_commcare_users_by_domain ( domain ) if user_type == WEB_USER_TYPE : return get_all_web_users_by_domain ( domain ) query = _get_es_query ( domain , user_type , user_filters ) if count_only : return query . count ( ) user_ids = query . scroll_ids ( ) return map ( CouchUser . wrap_correctly , iter_docs ( CommCareUser . get_db ( ) , user_ids ) )