code: def test_capping_potential_changepoints():
      df = pd.DataFrame(
          {
              "ts": pd.date_range(
                  start="2020-01-01", periods=366, freq="D"
              ),
              "y": np.random.randn(366),
          }
      )
      with LogCapture(LOGGER_NAME) as log_capture:
          cd = ChangepointDetector()
          cd.find_trend_changepoints(
              df=df,
              time_col="ts",
              value_col="y",
              resample_freq="D",
              potential_changepoint_distance="D",
              potential_changepoint_n_max=100,
          )
          log_capture.check_present(
              (
                  LOGGER_NAME,
                  "INFO",
                  f"Number of potential changepoints is capped by 'potential_changepoint_n_max' "
                  f"as 100. The 'potential_changepoint_distance' D is ignored. "
                  f"The original number of changepoints was 365.",
              )
          )
  
imports: from datetime import timedelta
  import numpy
  import pandas
  import pytest
  from pandas.tseries.frequencies import to_offset
  from sklearn.base import RegressorMixin
  from testfixtures import LogCapture
  from greykite.algo.changepoint.adalasso.changepoint_detector import ChangepointDetector
  from greykite.algo.changepoint.adalasso.changepoint_detector import get_changepoints_dict
  from greykite.algo.changepoint.adalasso.changepoint_detector import get_seasonality_changepoints
  from greykite.algo.changepoint.shift_detection.shift_detector import ShiftDetection
  from greykite.common.data_loader import DataLoader
  from greykite.common.logging import LOGGER_NAME
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_arbitrary_trends_and_shifts
  from greykite.common.testing_utils import generate_test_changepoint_df
label_desc: Use image node_id 10 for calling a global function with example usage: test_capping_potential_changepoints() without return types