code: def test_get_anomaly_df_from_outliers_raise_error():
      """Tests `get_anomaly_df_from_outliers` error catching."""
      value_col = "y"
      freq = "H"
      # Tests when outliers exist.
      # The outliers are to be identified and saved to `anomaly_df`.
      y = [2, 1e10] + [2] * 998
      df = pd.DataFrame(
          {
              TIME_COL: pd.date_range(
                  start="2020-01-01",
                  end="2020-02-11 15:00:00",
                  freq=freq,
              ),
              value_col: y,
          }
      )
      # Captures Error when input `time_col` is not in `df`.
      non_exist_col = "column not exist"
      with pytest.raises(
          ValueError,
          match=f"`df` does not have `time_col` with name {non_exist_col}.",
      ):
          get_anomaly_df_from_outliers(
              df=df,
              time_col=non_exist_col,
              value_col=value_col,
              freq=freq,
          )
  
      # Captures Error when input `value_col` is not in `df`.
      with pytest.raises(
          ValueError,
          match=f"`df` does not have `value_col` with name {non_exist_col}.",
      ):
          get_anomaly_df_from_outliers(
              df=df,
              time_col=TIME_COL,
              value_col=non_exist_col,
              freq=freq,
          )
  
imports: import itertools
  import numpy
  import pandas
  import pytest
  from testfixtures import LogCapture
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.testing_utils import assert_equal
  from greykite.detection.detector.ad_utils import add_new_params_to_records
  from greykite.detection.detector.ad_utils import get_anomaly_df
  from greykite.detection.detector.ad_utils import get_anomaly_df_from_outliers
  from greykite.detection.detector.ad_utils import get_canonical_anomaly_df
  from greykite.detection.detector.ad_utils import get_timestamp_ceil
  from greykite.detection.detector.ad_utils import get_timestamp_floor
  from greykite.detection.detector.ad_utils import optimize_df_with_constraints
  from greykite.detection.detector.ad_utils import partial_return
  from greykite.detection.detector.ad_utils import validate_volatility_features
  from greykite.detection.detector.ad_utils import vertical_concat_dfs
label_desc: Use image node_id 13 for calling a global function with example usage: test_get_anomaly_df_from_outliers_raise_error() without return types