def _significance_pruning_step(pre_pruning_assembly):
    """
    Between two assemblies with the same unit set arranged into different
    configurations the most significant one is chosen.

    Parameters
    ----------
    pre_pruning_assembly : list
        contains the whole set of significant assemblies (unfiltered)

    Returns
    -------
    assembly : list
        contains the filtered assemblies
    n_filtered_assemblies : int
        number of filtered assemblies by the function
    """
    nns = len(pre_pruning_assembly)
    selection = []
    assembly = []
    for i in range(nns):
        elem = sorted(pre_pruning_assembly[i]['neurons'])
        if elem in selection:
            pre = selection.index(elem)
            if pre_pruning_assembly[i]['pvalue'][-1] <= assembly[pre]['pvalue'
                ][-1]:
                selection[pre] = elem
                assembly[pre] = pre_pruning_assembly[i]
        if elem not in selection:
            selection.append(elem)
            assembly.append(pre_pruning_assembly[i])
    n_filtered_assemblies = nns - len(assembly)
    return assembly, n_filtered_assemblies
