def get_expected():
    'Return expected data items sorted by id'
    items = [(item['_id'], item['_source']['first_name'], item['_source']['is_active']) for item in DATA]
    items = sorted(items, key=(lambda tup: (tup[1], (not tup[2]))))
    return items
Return expected data items sorted by id
def get_expected():
    
    items = [(item['_id'], item['_source']['first_name'], item['_source']['is_active']) for item in DATA]
    items = sorted(items, key=(lambda tup: (tup[1], (not tup[2]))))
    return items