code: def get_changepoint_resample_freq(
      n_points: int,
      min_increment: timedelta,
      min_num_points_after_agg: int = 100,
  ) -> Optional[str]:
      """Gets the changepoint detection resample frequency parameter.
  
      Parameters
      ----------
      n_points : `int`
          The number of data points in the time series.
      min_increment : `datetime.timedelta`
          The minimum increment between time series points.
      min_num_points_after_agg : `int`, default 100
          The minimum number of observations required after aggregation.
  
      Returns
      -------
      resample_freq : `str` or None
          The resample frequency.
          Will be one of "D", "3D" and "7D".
          If None, resample will be skipped.
      """
      # When ``min_increment`` is at least 7 days,
      # the data is considered at least weekly data.
      # In this case, we don't do aggregation.
      if min_increment >= timedelta(days=7):
          # Returning None for this case.
          return None
  
      # From now on the data is sub-weekly.
      # The candidates of ``resample_freq`` are "7D", "3D" and "D".
      # We use the longest aggregation frequency that has at least
      # ``min_num_points_after_agg`` points after aggregation.
      # Currently, we do not support sub-daily aggregation frequency,
      # because it is not a common case.
      # We also do not recommend based on detection result for speed purpose.
      data_length = n_points * min_increment
      if data_length >= timedelta(days=7 * min_num_points_after_agg):
          resample_freq = "7D"
      elif data_length >= timedelta(days=3 * min_num_points_after_agg):
          resample_freq = "3D"
      else:
          resample_freq = "D"
  
      return resample_freq
  
file_path: greykite/greykite/algo/changepoint/adalasso/auto_changepoint_params.py
imports: from datetime import timedelta
  from typing import Optional
  import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  from greykite.algo.common.seasonality_inferrer import SeasonalityInferConfig
  from greykite.algo.common.seasonality_inferrer import SeasonalityInferrer
  from greykite.algo.common.seasonality_inferrer import TrendAdjustMethodEnum
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
label_desc: Use image node_id 1 for calling a global function with example usage: get_changepoint_resample_freq(n_points, min_increment, min_num_points_after_agg) and returns: resample_freq, None