code: def _update_fig_dimensions(
      fig: go.Figure,
      fig_kwargs: Dict[str, Any],
      fig_defaults: Dict[str, Any],
  ) -> go.Figure:
      """Updates the dimensions of the Plotly figure using fig_kwargs.
      If "width" and/or "height" are available in fig_kwargs, they are used, else
      they are picked from the fig_defaults. If both end up being None, figure
      dimensions are not updated.
  
      Parameters
      ----------
      fig : go.Figure
          Plotly figure whose dimensions need to be updated
      fig_kwargs : Dict[str, Any]
          A dictionary containing options keys for "width" and/or "height".
      fig_defaults : Dict[str, Any]
          The defaults dictionary containing keys for "width" and "height" (mandatory)
  
      Returns
      -------
      go.Figure
          The Plotly figure with updated dimensions.
      """
      width = _resolve_dict_keys(
          dict_=fig_kwargs, key="width", defaults=fig_defaults
      )
      height = _resolve_dict_keys(
          dict_=fig_kwargs, key="height", defaults=fig_defaults
      )
      if width is not None or height is not None:
          fig.update_layout(autosize=False, width=width, height=height)
      return fig
  
imports: from math import ceil
  from typing import Any, Dict, List, Optional, Tuple, Union
  import matplotlib
  import matplotlib.pyplot
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  import plotly.io
  from plotly.colors import DEFAULT_PLOTLY_COLORS
  from plotly.subplots import make_subplots
  from scipy.fft import fft, fftfreq
  from scipy.signal import periodogram
  from statsmodels.graphics.gofplots import qqplot
  from statsmodels.tsa.seasonal import STL, seasonal_decompose
  from statsmodels.tsa.stattools import acf, ccf, pacf
  from pycaret.internal.logging import get_logger
  from pycaret.utils.generic import _resolve_dict_keys
  from pycaret.utils.time_series import TSAllowedPlotDataTypes
label_desc: Use image node_id 13 for calling a global function with example usage: _update_fig_dimensions(fig, fig_kwargs, fig_defaults) and returns: fig