code: def plot_trend_change(
      m, quantile, plot_name="Trend Change", df_name="__df__"
  ):
      """Make a barplot of the magnitudes of trend-changes.
  
      Parameters
      ----------
          m : NeuralProphet
              Fitted model
          quantile : float
              The quantile for which the yearly seasonality is plotted
          plot_name : str
              Name of the plot Title
          df_name : str
              Name of dataframe to refer to data params from original keys of train dataframes
  
              Note
              ----
              Only used for local normalization in global modeling
  
      Returns
      -------
          Dictionary with plotly traces, xaxis and yaxis
      """
      if isinstance(df_name, list):
          df_name = df_name[0]
      data_params = m.config_normalization.get_data_params(df_name)
      start = data_params["ds"].shift
      scale = data_params["ds"].scale
      time_span_seconds = scale.total_seconds()
      cp_t = np.array([])
      for cp in m.model.config_trend.changepoints:
          cp_t = np.append(
              cp_t,
              start
              + datetime.timedelta(seconds=cp * time_span_seconds),
          )
      # Global/Local Mode
      if m.model.config_trend.trend_global_local == "local":
          quantile_index = m.model.quantiles.index(quantile)
          weights = m.model.trend.get_trend_deltas.detach()[
              quantile_index, m.model.id_dict[df_name], :
          ].numpy()
      else:
          quantile_index = m.model.quantiles.index(quantile)
          weights = m.model.trend.get_trend_deltas.detach()[
              quantile_index, 0, :
          ].numpy()
      # add end-point to force scale to match trend plot
      cp_t = np.append(cp_t, start + scale)
      weights = np.append(weights, [0.0])
  
      traces = []
      traces.append(
          go.Bar(
              name=plot_name,
              x=cp_t,
              y=weights,
              marker_color=color,
          ),
      )
  
      padded_range = get_dynamic_axis_range(cp_t, type="dt")
      xaxis = go.layout.XAxis(
          title="Trend segment",
          type="date",
          range=padded_range,
      )
      yaxis = go.layout.YAxis(
          rangemode="normal",
          title=go.layout.yaxis.Title(text=plot_name),
      )
  
      return {"traces": traces, "xaxis": xaxis, "yaxis": yaxis}
  
file_path: neural_prophet/neuralprophet/plot_model_parameters_plotly.py
imports: import datetime
  import logging
  import numpy
  import pandas
  from neuralprophet.plot_utils import predict_one_season, predict_season_from_dates
label_desc: Use image node_id 2 for calling a global function with example usage: plot_trend_change(m, quantile, plot_name, df_name) and returns: dict