(partition_values)
return list(mapping.items())
:param partition_values: Iterable of partition values (e.g. case IDs)
    :return: list of tuples (db_name, list(partition_values))
:param partition_values: Iterable of partition values (e.g. case IDs)
    :return: list of tuples (db_name, list(partition_values))
: param partition_values : Iterable of partition values ( e . g . case IDs ) : return : list of tuples ( db_name list ( partition_values ))
def split_list_by_db_partition(partition_values):
    """
    :param partition_values: Iterable of partition values (e.g. case IDs)
    :return: list of tuples (db_name, list(partition_values))
    """
    mapping = defaultdict(list)
    for value in partition_values:
        db_name = get_db_alias_for_partitioned_doc(value)
        mapping[db_name].append(value)
    return list(mapping.items())
def split_list_by_db_partition ( partition_values ) : mapping = defaultdict ( list ) for value in partition_values : db_name = get_db_alias_for_partitioned_doc ( value ) mapping [ db_name ] . append ( value ) return list ( mapping . items ( ) )