code: def test_create_df_with_regressor():
      # create inputs
      input_shiftsm = [
          (
              datetime(2020, 1, 11, 0, 0, 0),
              datetime(2020, 1, 11, 0, 0, 0),
          ),
          (
              datetime(2020, 1, 21, 0, 0, 0),
              datetime(2020, 1, 21, 0, 0, 0),
          ),
      ]
      input_val_ls = [100] * 10 + [200] * 10 + [300] * 10
      input_ts_ls = pd.date_range(
          datetime(2020, 1, 1), freq="D", periods=30
      )
      input_df = pd.DataFrame(
          {"ts": input_ts_ls, "actual": input_val_ls}
      )
  
      # create expected outputs
      expected_df_regressor = pd.DataFrame(
          {
              "ts": pd.date_range(
                  datetime(2020, 1, 1), freq="D", periods=30
              ),
              "actual": [100] * 10 + [200] * 10 + [300] * 10,
              f"{LEVELSHIFT_COL_PREFIX_SHORT}_2020_01_11_00_00": [0]
              * 10
              + [1] * 20,
              f"{LEVELSHIFT_COL_PREFIX_SHORT}_2020_01_21_00_00": [0]
              * 20
              + [1] * 10,
          }
      )
  
      # call the function
      detector = ShiftDetection()
      output_df_regressor = detector.create_df_with_regressor(
          input_df, "ts", input_shiftsm
      )
  
      # unit test
      pd.testing.assert_frame_equal(
          output_df_regressor, expected_df_regressor
      )
  
file_path: greykite/greykite/tests/algo/changepoint/shift_detection/test_shift_detector.py
imports: from datetime import datetime
  import pandas
  import pytest
  from greykite.algo.changepoint.shift_detection.shift_detector import ShiftDetection
  from greykite.common.constants import LEVELSHIFT_COL_PREFIX_SHORT
label_desc: Use image node_id 6 for calling a global function with example usage: test_create_df_with_regressor() without return types