def ts_fit(
        series: Union[TimeSeries, Sequence[TimeSeries]],
        params: Mapping[str, Any],
        *args,
        **kwargs,
    ):
        """The function that will be applied to each series when :func:`fit` is called.

        If the `global_fit` attribute is set to `False`, then `ts_fit` should accept a `TimeSeries` as a first
        argument and return a set of parameters that are fitted to this individual `TimeSeries`. Conversely, if the
        `global_fit` attribute is set to `True`, then `ts_fit` should accept a `Sequence[TimeSeries]` and
        return a set of parameters that are fitted to *all* of the provided `TimeSeries`. All these parameters will
        be stored in ``self._fitted_params``, which can be later used during the transformation step.

        Regardless of whether the `global_fit` attribute is set to `True` or `False`, `ts_fit` should also accept
        a dictionary of fixed parameter values as a second argument (i.e. `params['fixed'] contains the fixed
        parameters of the data transformer).

        Any additional positional and/or keyword arguments passed to the `fit` method will be passed as
        positional/keyword arguments to `ts_fit`.

        This method is not implemented in the base class and must be implemented in the deriving classes.

        If more parameters are added as input in the derived classes, :func:`_fit_iterator()`
        should be redefined accordingly, to yield the necessary arguments to this function (See
        :func:`_fit_iterator()` for further details)

        Parameters
        ----------
        series (Union[TimeSeries, Sequence[TimeSeries]])
            `TimeSeries` against which the scaler will be fit.

        Notes
        -----
        This method is designed to be a static method instead of instance methods to allow an efficient
        parallelisation also when the scaler instance is storing a non-negligible amount of data. Using instance
        methods would imply copying the instance's data through multiple processes, which can easily introduce a
        bottleneck and nullify parallelisation benefits.
        """
        pass
The function that will be applied to each series when :func:`fit` is called.

        If the `global_fit` attribute is set to `False`, then `ts_fit` should accept a `TimeSeries` as a first
        argument and return a set of parameters that are fitted to this individual `TimeSeries`. Conversely, if the
        `global_fit` attribute is set to `True`, then `ts_fit` should accept a `Sequence[TimeSeries]` and
        return a set of parameters that are fitted to *all* of the provided `TimeSeries`. All these parameters will
        be stored in ``self._fitted_params``, which can be later used during the transformation step.

        Regardless of whether the `global_fit` attribute is set to `True` or `False`, `ts_fit` should also accept
        a dictionary of fixed parameter values as a second argument (i.e. `params['fixed'] contains the fixed
        parameters of the data transformer).

        Any additional positional and/or keyword arguments passed to the `fit` method will be passed as
        positional/keyword arguments to `ts_fit`.

        This method is not implemented in the base class and must be implemented in the deriving classes.

        If more parameters are added as input in the derived classes, :func:`_fit_iterator()`
        should be redefined accordingly, to yield the necessary arguments to this function (See
        :func:`_fit_iterator()` for further details)

        Parameters
        ----------
        series (Union[TimeSeries, Sequence[TimeSeries]])
            `TimeSeries` against which the scaler will be fit.

        Notes
        -----
        This method is designed to be a static method instead of instance methods to allow an efficient
        parallelisation also when the scaler instance is storing a non-negligible amount of data. Using instance
        methods would imply copying the instance's data through multiple processes, which can easily introduce a
        bottleneck and nullify parallelisation benefits.
        
darts/dataprocessing/transformers/fittable_data_transformer.py