(domain, location_ids)
return ret
Returns {user_id: primary_location_id, ...}
Returns {user_id: primary_location_id, ...}
Returns { user_id : primary_location_id ... }
def get_user_ids_from_primary_location_ids(domain, location_ids):
    """
    Returns {user_id: primary_location_id, ...}
    """
    result = (
        UserES()
        .domain(domain)
        .primary_location(location_ids)
        .non_null('location_id')
        .fields(['location_id', '_id'])
        .run().hits
    )
    ret = {}
    for r in result:
        if 'location_id' in r:
            loc = r['location_id']
            ret[r['_id']] = loc
    return ret
def get_user_ids_from_primary_location_ids ( domain , location_ids ) : result = ( UserES ( ) . domain ( domain ) . primary_location ( location_ids ) . non_null ( 'location_id' ) . fields ( [ 'location_id' , '_id' ] ) . run ( ) . hits ) ret = { } for r in result : if 'location_id' in r : loc = r [ 'location_id' ] ret [ r [ '_id' ] ] = loc return ret