code: def plot_change(
      observation=None,
      adaptive_lasso_estimate=None,
      trend_change=None,
      trend_estimate=None,
      year_seasonality_estimate=None,
      seasonality_change=None,
      seasonality_estimate=None,
      title=None,
      xaxis="Dates",
      yaxis="Values",
  ):
      """Makes a plot of the observed data and estimated components, as well as detected changes
  
      The function currently allows five different components to be plotted together. Specifically,
      ``trend_change`` can be plotted with at least one of ``observations``, ``trend_estimate`` and
      ``adaptive_lasso_estimate`` is provided.
  
      Parameters
      ----------
      observation : `pandas.Series` with time index or `None`
          The observed values, leave None to omit it from plot.
      adaptive_lasso_estimate : `pandas.Series` with time index or `None`
          The adaptive lasso estimated trend, leave None to omit it from plot.
      trend_change : `pandas.Series` with time index or `None`
          The detected trend change points, leave None to omit it from plot.
          Plotted as vertical lines if observation is provided, otherwise plotted as markers.
      trend_estimate : `pandas.Series` with time index or `None`
          The estimated trend, leave None to omit it from plot.
      year_seasonality_estimate : `pandas.Series` with time index or `None`
          The estimated yearly seasonality, leave None to omit it from plot.
      seasonality_change : `list` or `dict` or `None`
          The detected seasonality change points, leave None to omit it from plot.
          If the type is `list`, it should be a list of change points of all components.
          If the type is `dict`, its keys should be the name of components, and values
          should be the corresponding list of change points.
      seasonality_estimate : `pandas.Series` or `None`
          The estimated seasonality, leave None to omit it from plot.
      title : `str` or `None`
          Plot title.
      xaxis : `str`
          Plot x axis label.
      yaxis : `str`
          Plot y axis label.
  
      Returns
      -------
      fig : `plotly.graph_objects.Figure`
          The plotted plotly object, can be shown with `fig.show()`.
      """
      if title is None:
          if trend_change is None and seasonality_change is None:
              title = "Timeseries Plot"
          elif trend_change is None:
              title = "Timeseries Plot with detected seasonality change points"
          elif seasonality_change is None:
              title = (
                  "Timeseries Plot with detected trend change points"
              )
          else:
              title = "Timeseries Plot with detected trend and seasonality change points"
      fig = go.Figure()
      # shows the true observation
      if observation is not None:
          fig.add_trace(
              go.Scatter(
                  x=observation.index,
                  y=observation,
                  name="true",
                  mode="lines",
                  line=dict(color="#42A5F5"),  # blue 400
                  opacity=1,
              )
          )
      # shows the seasonality estimate
      if seasonality_estimate is not None:
          fig.add_trace(
              go.Scatter(
                  name="seasonality+trend",
                  mode="lines",
                  x=seasonality_estimate.index,
                  y=seasonality_estimate,
                  line=dict(color="#B2FF59"),  # light green A200
                  opacity=0.7,
                  showlegend=True,
              )
          )
      # shows the adaptive lasso estimated trend
      if adaptive_lasso_estimate is not None:
          fig.add_trace(
              go.Scatter(
                  name="adaptive lasso estimated trend",
                  mode="lines",
                  x=adaptive_lasso_estimate.index,
                  y=adaptive_lasso_estimate,
                  line=dict(color="#FFA726"),  # orange 400
                  opacity=1,
                  showlegend=True,
              )
          )
      # shows the detected trend change points
      # shown as vertical lines if ``observation`` is provided, otherwise as markers
      if trend_change is not None:
          if (
              observation is not None
              or seasonality_estimate is not None
          ):
              if observation is not None:
                  min_y = min(0, observation.min())
                  max_y = max(0, observation.max())
              else:
                  min_y = min(0, seasonality_estimate.min())
                  max_y = max(0, seasonality_estimate.max())
              for i, cp in enumerate(trend_change):
                  showlegend = i == 0
                  fig.add_trace(
                      go.Scatter(
                          name="trend change point",
                          mode="lines",
                          x=[pd.to_datetime(cp), pd.to_datetime(cp)],
                          y=[min_y, max_y],
                          line=go.scatter.Line(
                              color="#F44336",  # red 500
                              width=1.5,
                              dash="dash",
                          ),
                          opacity=1,
                          showlegend=showlegend,
                          legendgroup="trend",
                      )
                  )
          elif (
              trend_estimate is not None
              or adaptive_lasso_estimate is not None
          ):
              trend = (
                  trend_estimate
                  if trend_estimate is not None
                  else adaptive_lasso_estimate
              )
              for cp in trend_change:
                  value = trend[cp]
                  fig.add_trace(
                      go.Scatter(
                          name="trend change points",
                          mode="markers",
                          x=[pd.to_datetime(cp)],
                          y=[value],
                          marker=dict(
                              color="#F44336",  # red 500
                              size=15,
                              line=dict(color="Black", width=1.5),
                          ),
                          opacity=0.2,
                          showlegend=False,
                      )
                  )
          else:
              warnings.warn(
                  "trend_change is not shown. Must provide observations, trend_estimate, "
                  "adaptive_lasso_estimate or seasonality_estimate to plot trend_change."
              )
              return None
      # shows the detected seasonality change points
      if seasonality_change is not None:
          if (
              observation is not None
              or seasonality_estimate is not None
          ):
              if observation is not None:
                  min_y = min(0, observation.min())
                  max_y = max(0, observation.max())
              else:
                  min_y = min(0, seasonality_estimate.min())
                  max_y = max(0, seasonality_estimate.max())
              if isinstance(seasonality_change, list):
                  for i, cp in enumerate(seasonality_change):
                      showlegend = i == 0
                      fig.add_trace(
                          go.Scatter(
                              name="seasonality change point",
                              mode="lines",
                              x=[
                                  pd.to_datetime(cp),
                                  pd.to_datetime(cp),
                              ],
                              y=[min_y, max_y],
                              line=go.scatter.Line(
                                  color="#1E88E5",  # blue 600
                                  width=1.5,
                                  dash="dash",
                              ),
                              opacity=1,
                              showlegend=showlegend,
                              legendgroup="seasonality",
                          )
                      )
              elif isinstance(seasonality_change, dict):
                  colors = [
                      "#2196F3",
                      "#0D47A1",
                  ]  # [blue 500, blue 900]
                  dashes = ["dash", "dot", "dashdot", None]
                  types = [
                      (color, dash)
                      for color in colors
                      for dash in dashes
                  ]
                  quota = len(types)
                  for i, (key, changepoints) in enumerate(
                      seasonality_change.items()
                  ):
                      if quota == 0:
                          warnings.warn(
                              "Only the first 8 components with detected change points"
                              "are plotted."
                          )
                          break
                      if changepoints:
                          for j, cp in enumerate(changepoints):
                              showlegend = j == 0
                              fig.add_trace(
                                  go.Scatter(
                                      name="seasonality change point "
                                      + key,
                                      mode="lines",
                                      x=[
                                          pd.to_datetime(cp),
                                          pd.to_datetime(cp),
                                      ],
                                      y=[min_y, max_y],
                                      line=go.scatter.Line(
                                          color=types[i][0],
                                          width=1.5,
                                          dash=types[i][1],
                                      ),
                                      opacity=1,
                                      showlegend=showlegend,
                                      legendgroup=key,
                                  )
                              )
                          quota -= 1
              else:
                  raise ValueError(
                      "seasonality_change must be either list or dict."
                  )
          else:
              warnings.warn(
                  "seasonality_change is not shown. Must provide observations or"
                  " seasonality_estimate to plot seasonality_change."
              )
      # shows the estimated trend
      if trend_estimate is not None:
          fig.add_trace(
              go.Scatter(
                  name="trend",
                  mode="lines",
                  x=trend_estimate.index,
                  y=trend_estimate,
                  line=dict(color="#FFFF00", width=2),  # yellow A200
                  opacity=1,
                  showlegend=True,
              )
          )
      # shows the estimated yearly seasonality
      if year_seasonality_estimate is not None:
          fig.add_trace(
              go.Scatter(
                  name="yearly seasonality",
                  mode="lines",
                  x=year_seasonality_estimate.index,
                  y=year_seasonality_estimate,
                  line=dict(color="#BF360C"),  # deep orange 900
                  opacity=0.6,
                  showlegend=True,
              )
          )
      fig.update_layout(
          dict(
              xaxis=dict(title=xaxis),
              yaxis=dict(title=yaxis),
              title=title,
              title_x=0.5,
          )
      )
      return fig
  
imports: import warnings
  from datetime import timedelta
  import numpy
  import pandas
  import plotly.graph_objects
  from pandas.plotting import register_matplotlib_converters
  from pandas.tseries.frequencies import to_offset
  from sklearn.linear_model import Lasso
  from sklearn.linear_model import LassoCV
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import RidgeCV
  from greykite.common.constants import CHANGEPOINT_COL_PREFIX
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.features.timeseries_features import add_time_features_df
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_changepoint_dates_from_changepoints_dict
  from greykite.common.features.timeseries_features import get_changepoint_features
  from greykite.common.features.timeseries_features import get_changepoint_features_and_values_from_config
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
  from greykite.common.python_utils import get_pattern_cols
  from greykite.common.python_utils import unique_elements_in_list
label_desc: Use image node_id 6 for calling a global function with example usage: plot_change(observation, adaptive_lasso_estimate, trend_change, trend_estimate, year_seasonality_estimate, seasonality_change, seasonality_estimate, title, xaxis, yaxis) and returns: fig, None