def find_common_transforms_group(
    datasets: Iterable[Any], default_group: str = "train"
) -> str:
    """
    Utility used to find the common transformations group across multiple
    datasets.

    To compute the common group, the current one is used. Objects which are not
    instances of :class:`AvalancheDataset` are ignored.
    If no common group is found, then the default one is returned.

    :param datasets: The list of datasets.
    :param default_group: The name of the default group.
    :returns: The name of the common group.
    """
    # Find common "current_group" or use "train"
    uniform_group: Optional[str] = None
    for d_set in datasets:
        if isinstance(d_set, AvalancheDataset):
            if uniform_group is None:
                uniform_group = d_set._flat_data._transform_groups.current_group
            else:
                if uniform_group != d_set._flat_data._transform_groups.current_group:
                    uniform_group = None
                    break

    if uniform_group is None:
        initial_transform_group = default_group
    else:
        initial_transform_group = uniform_group

    return initial_transform_group

    Utility used to find the common transformations group across multiple
    datasets.

    To compute the common group, the current one is used. Objects which are not
    instances of :class:`AvalancheDataset` are ignored.
    If no common group is found, then the default one is returned.

    :param datasets: The list of datasets.
    :param default_group: The name of the default group.
    :returns: The name of the common group.
    
avalanche/benchmarks/utils/utils.py