def _assert_same_length(
    list_series_1: Sequence[TimeSeries],
    list_series_2: Sequence[TimeSeries],
    name_series_1: str,
    name_series_2: str,
):
    """Checks if the two sequences contain the same number of TimeSeries."""

    if len(list_series_1) != len(list_series_2):
        raise_log(
            ValueError(
                f"Number of `{name_series_2}` must match the number of given "
                f"`{name_series_1}`, found length {len(list_series_2)} and "
                f"expected {len(list_series_1)}."
            ),
            logger=logger,
        )
Checks if the two sequences contain the same number of TimeSeries.
darts/ad/utils.py