code: def test_load_data_anomaly():
      """Checks anomaly_info parameter"""
      dl = DataLoaderTS()
      df = dl.load_beijing_pm()
      value_col = "pm"
  
      # no anomaly adjustment
      ts = UnivariateTimeSeries()
      ts.load_data(df=df, value_col=value_col)
      assert ts.df_before_adjustment is None
  
      # adjusts two columns
      dim_one = "one"
      dim_two = "two"
      anomaly_df = pd.DataFrame(
          {
              START_TIME_COL: [
                  "2011-04-04-10",
                  "2011-10-10-00",
                  "2012-12-20-10",
              ],
              END_TIME_COL: [
                  "2011-04-05-20",
                  "2011-10-11-23",
                  "2012-12-20-13",
              ],
              ADJUSTMENT_DELTA_COL: [np.nan, 100.0, -100.0],
              METRIC_COL: [dim_one, dim_one, dim_two],
          }
      )
      anomaly_info = [
          {
              "value_col": value_col,
              "anomaly_df": anomaly_df,
              "start_time_col": START_TIME_COL,
              "end_time_col": END_TIME_COL,
              "adjustment_delta_col": ADJUSTMENT_DELTA_COL,
              "filter_by_dict": {METRIC_COL: dim_one},
              "adjustment_method": "add",
          },
          {
              "value_col": "pres",
              "anomaly_df": anomaly_df,
              "start_time_col": START_TIME_COL,
              "end_time_col": END_TIME_COL,
              "adjustment_delta_col": ADJUSTMENT_DELTA_COL,
              "filter_by_dict": {METRIC_COL: dim_two},
              "adjustment_method": "subtract",
          },
      ]
      ts = UnivariateTimeSeries()
      ts.load_data(
          df=df, value_col=value_col, anomaly_info=anomaly_info
      )
      canonical_data_dict = get_canonical_data(
          df=df, value_col=value_col, anomaly_info=anomaly_info
      )
      assert_equal(ts.df, canonical_data_dict["df"])
      assert_equal(
          ts.df_before_adjustment,
          canonical_data_dict["df_before_adjustment"],
      )
  
imports: import datetime
  from datetime import datetime
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from greykite.common.constants import ADJUSTMENT_DELTA_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import METRIC_COL
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.common.time_properties import get_canonical_data
  from greykite.common.viz.timeseries_plotting import add_groupby_column
  from greykite.framework.benchmark.data_loader_ts import DataLoaderTS
  from greykite.framework.constants import MEAN_COL_GROUP
  from greykite.framework.constants import OVERLAY_COL_GROUP
  from greykite.framework.constants import QUANTILE_COL_GROUP
  from greykite.framework.input.univariate_time_series import UnivariateTimeSeries
label_desc: Use image node_id 6 for calling a global function with example usage: test_load_data_anomaly() without return types