code: def test_ts_with_static_covariates(self):
      # univarite ts, same number of static covariates as components
      global_static_covs = pd.Series(
          data=[0, 1], index=["static_0", "static_1"]
      )
      monthly_with_static_covs = self.monthly_ts.with_static_covariates(
          global_static_covs
      )
  
      # multivariate ts, different number of static covariates than components
      components_static_covs = pd.DataFrame(
          data=[["low", 1, 9], ["high", 0, 2]],
          columns=["static_2", "static_3", "static_4"],
      )
      monthly_multivar_with_static_covs = (
          TimeSeries.from_times_and_values(
              times=generate_index(
                  start=pd.Timestamp("2000-01"), length=8, freq="M"
              ),
              values=np.stack([np.arange(2)] * 8),
              static_covariates=components_static_covs,
          )
      )
  
      # dropping the static covariates
      midas_drop_static_covs = MIDAS(
          low_freq="QS", drop_static_covariates=True
      )
      # testing univariate (with/without static covariates), multivariate with static covariates
      for ts in [
          self.monthly_ts,
          monthly_with_static_covs,
          monthly_multivar_with_static_covs,
      ]:
          quartely_ts = midas_drop_static_covs.fit_transform(ts)
          assert quartely_ts.static_covariates is None
          inv_quartely_ts = midas_drop_static_covs.inverse_transform(
              quartely_ts
          )
          assert inv_quartely_ts.static_covariates is None
  
      # keeping the static covariates
      midas_with_static_covs = MIDAS(
          low_freq="QS", drop_static_covariates=False
      )
      # univariate, no static covariates
      quartely_no_static = midas_with_static_covs.fit_transform(
          self.monthly_ts
      )
      assert quartely_no_static.static_covariates is None
      inv_quartely_no_static = midas_with_static_covs.inverse_transform(
          quartely_no_static
      )
      assert inv_quartely_no_static.static_covariates is None
  
      # univariate, with static covariates
      expected_static_covs = pd.concat(
          [monthly_with_static_covs.static_covariates] * 3
      )
      expected_static_covs.index = [
          "values_midas_0",
          "values_midas_1",
          "values_midas_2",
      ]
      quartely_univ_dropped_static = (
          midas_with_static_covs.fit_transform(monthly_with_static_covs)
      )
      assert quartely_univ_dropped_static.static_covariates.equals(
          expected_static_covs
      )
  
      inv_quartely_univ_dropped_static = (
          midas_with_static_covs.inverse_transform(
              quartely_univ_dropped_static
          )
      )
      assert inv_quartely_univ_dropped_static.static_covariates.equals(
          monthly_with_static_covs.static_covariates
      )
  
      # testing multivariate, with static covariates
      expected_static_covs = pd.concat(
          [monthly_multivar_with_static_covs.static_covariates] * 3
      )
      expected_static_covs.index = [
          "0_midas_0",
          "1_midas_0",
          "0_midas_1",
          "1_midas_1",
          "0_midas_2",
          "1_midas_2",
      ]
      quartely_multiv_dropped_static = (
          midas_with_static_covs.fit_transform(
              monthly_multivar_with_static_covs
          )
      )
      assert quartely_multiv_dropped_static.static_covariates.equals(
          expected_static_covs
      )
  
      inv_quartely_multiv_dropped_static = (
          midas_with_static_covs.inverse_transform(
              quartely_multiv_dropped_static
          )
      )
      assert (
          inv_quartely_multiv_dropped_static.static_covariates.equals(
              monthly_multivar_with_static_covs.static_covariates
          )
      )
  
imports: import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.dataprocessing.transformers import MIDAS
  from darts.models import LinearRegressionModel
  from darts.utils.timeseries_generation import generate_index, linear_timeseries
label_desc: Use image node_id 14 for calling the TestMIDAS obj's underlying member method code with example usage: obj.test_ts_with_static_covariates() without return types