code: def get_changepoint_string(changepoint_dates):
      """Gets proper formatted strings for changepoint dates.
  
      The default format is "_%Y_%m_%d_%H". When necessary, it appends "_%M" or "_%M_%S".
  
      Parameters
      ----------
      changepoint_dates : `list`
          List of changepoint dates, parsable by `pandas.to_datetime`.
  
      Returns
      -------
      date_strings : `list[`str`]`
          List of string formatted changepoint dates.
      """
      changepoint_dates = list(pd.to_datetime(changepoint_dates))
      time_format = "_%Y_%m_%d_%H"
      if any([stamp.second != 0 for stamp in changepoint_dates]):
          time_format += "_%M_%S"
      elif any([stamp.minute != 0 for stamp in changepoint_dates]):
          time_format += "_%M"
      date_strings = [
          date.strftime(time_format) for date in changepoint_dates
      ]
      return date_strings
  
imports: import math
  from datetime import datetime
  from datetime import timedelta
  import numpy
  import pandas
  import pytz
  from holidays_ext import get_holidays
  from pandas.tseries.frequencies import to_offset
  from scipy.special import expit
  from greykite.common import constants
  from greykite.common.python_utils import split_offset_str
label_desc: Use image node_id 20 for calling a global function with example usage: get_changepoint_string(changepoint_dates) and returns: date_strings