code: def remove_from_series(
      ts: TimeSeries,
      other: TimeSeries,
      model: Union[SeasonalityMode, ModelMode],
  ) -> TimeSeries:
      """
      Removes the TimeSeries `other` from the TimeSeries `ts` as specified by `model`.
      Use e.g. to remove an additive or multiplicative trend from a series.
  
      Parameters
      ----------
      ts
          The TimeSeries to be modified.
      other
          The TimeSeries to remove.
      model
          The type of model considered.
          Must be ``from darts.utils.utils import ModelMode, SeasonalityMode`` Enums member.
          Either ``MULTIPLICATIVE`` or ``ADDITIVE``.
          Defaults ``ModelMode.MULTIPLICATIVE``.
  
      Returns
      -------
      TimeSeries
          A TimeSeries defined by removing `other` from `ts`.
      """
  
      ts._assert_univariate()
      raise_if_not(
          model in ModelMode or model in SeasonalityMode,
          f"Unknown value for model_mode: {model}.",
          logger,
      )
  
      if model.value == "multiplicative":
          new_ts = ts / other
      elif model.value == "additive":
          new_ts = ts - other
      else:
          raise_log(
              ValueError(
                  "Invalid parameter; must be either ADDITIVE or MULTIPLICATIVE. Was: {}".format(
                      model
                  )
              )
          )
      return new_ts
  
imports: import math
  from typing import List, Optional, Sequence, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from scipy.signal import argrelmax
  from scipy.stats import norm
  from statsmodels.tsa.seasonal import MSTL, STL, seasonal_decompose
  from statsmodels.tsa.stattools import acf, adfuller, grangercausalitytests, kpss, pacf
  from darts import TimeSeries
  from darts.logging import get_logger, raise_if, raise_if_not, raise_log
  from .missing_values import fill_missing_values
  from .utils import ModelMode, SeasonalityMode
label_desc: Use image node_id 4 for calling a global function with example usage: remove_from_series(ts, other, model) and returns: new_ts