code: def _plotly_viz_decomposition(
      result, dates, title="Time Series Decomposition"
  ):
      """Create timeseries decomposition visualization.
  
      Args:
          result: The statsmodels.tsa.seasonal.DecomposeResult object. Defaults to None.
          dates: The datetime index
          title: Title of the plot. Defaults to "Time Series Decomposition".
  
      Returns:
          The visualization
      """
      fig = make_subplots(
          rows=4, cols=1, x_title="Time", shared_xaxes=True
      )
      fig.add_trace(
          go.Scatter(
              x=dates,
              y=result.observed,
              name="observed",
          ),
          row=1,
          col=1,
      )
      fig.add_trace(
          go.Scatter(x=dates, y=result.trend, name="trend"),
          row=2,
          col=1,
      )
      fig.add_trace(
          go.Scatter(x=dates, y=result.seasonal, name="seasonal"),
          row=3,
          col=1,
      )
      fig.add_trace(
          go.Scatter(x=dates, y=result.resid, name="residual"),
          row=4,
          col=1,
      )
      fig.update_layout(
          height=get_option("display.plotly.fig_height"),
          width=get_option("display.plotly.fig_width"),
          title_text=title,
          legend_title_text="Decomposition",
      )
      return fig
  
imports: import warnings
  from typing import Optional
  import matplotlib.pyplot
  import seaborn
  import pandas
  import numpy
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from plotly.offline import init_notebook_mode, iplot
  from data_describe.config._config import get_option
  from data_describe.backends import _get_viz_backend, _get_compute_backend
  from data_describe.compat import _is_dataframe, _compat, _requires, _in_notebook
label_desc: Use image node_id 10 for calling a global function with example usage: _plotly_viz_decomposition(result, dates, title) and returns: fig