code: def test_contaminate_df_with_anomalies():
      # data size
      n = 2000
      res = generate_df_for_tests(
          freq="1D",
          periods=n,
          train_start_date=datetime.datetime(2018, 7, 1),
      )
      df = res["df"]
  
      res = generate_anomaly_blocks(
          timeseries_length=n, block_number=20, mean_block_size=5
      )
  
      anomaly_block_list = res["anomaly_block_list"]
  
      df = contaminate_df_with_anomalies(
          df=df,
          anomaly_block_list=anomaly_block_list,
          delta_range_lower=5,
          delta_range_upper=6,
          value_col="y",
          min_admissible_value=None,
          max_admissible_value=None,
      )
      assert df.shape == (2000, 4)
      assert list(df.columns) == [
          "ts",
          "y",
          "contaminated_y",
          "is_anomaly",
      ]
      assert not df.isna().any().any()
  
file_path: greykite/greykite/tests/common/test_testing_utils_anomalies.py
imports: import datetime
  import numpy
  import pandas
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils_anomalies import calc_quantiles_simulated_df
  from greykite.common.testing_utils_anomalies import contaminate_df_with_anomalies
  from greykite.common.testing_utils_anomalies import generate_anomaly_blocks
  from greykite.common.testing_utils_anomalies import generate_df_with_anomalies_sim_based
label_desc: Use image node_id 2 for calling a global function with example usage: test_contaminate_df_with_anomalies() without return types