def ts_fit(
        series: Union[TimeSeries, Sequence[TimeSeries]],
        params: Mapping[str, Any],
        *args,
        **kwargs,
    ) -> Union[dict[str, Any], list[dict[str, Any]]]:
        """MIDAS needs the high frequency period name in order to easily reverse_transform
        TimeSeries, the parallelization is handled by `transform` and/or `inverse_transform`
        (see InvertibleDataTransformer.__init__() docstring).
        """
        is_single_series = isinstance(series, TimeSeries)

        if is_single_series:
            series = [series]

        fitted_params = []
        low_freq = params["fixed"]["_low_freq"]
        for idx, ts in enumerate(series):
            high_freq = ts.freq_str
            if not pd.tseries.frequencies.is_subperiod(
                pd.tseries.frequencies.get_period_alias(high_freq),
                pd.tseries.frequencies.get_period_alias(low_freq),
            ):
                raise_log(
                    ValueError(
                        f"The frequency string of the series at index={idx} must be higher than the "
                        f"`low_freq` set at MIDAS creation. "
                        f"Received series frequency {high_freq} against `low_freq={low_freq}`"
                    ),
                    logger=logger,
                )
            fitted_params.append({
                "high_freq": high_freq,
                "start": ts.start_time(),
                "end": ts.end_time(),
            })
        return fitted_params[0] if is_single_series else fitted_params
MIDAS needs the high frequency period name in order to easily reverse_transform
        TimeSeries, the parallelization is handled by `transform` and/or `inverse_transform`
        (see InvertibleDataTransformer.__init__() docstring).
        
darts/dataprocessing/transformers/midas.py