code: def plot_lagged_weights(weights, comp_name, focus=None):
      """Make a barplot of the importance of lagged inputs.
  
      Parameters
      ----------
          weights : list
              tuples of (name, weights)
          comp_name : str
              Name of lagged inputs
          focus : int
              Show weights for this forecast, if provided
  
      Returns
      -------
          Dictionary with plotly traces, xaxis and yaxis
      """
      traces = []
  
      n_lags = weights.shape[1]
      lags_range = np.array(range(1, 1 + n_lags))[::-1]
      if focus is None:
          weights = np.sum(np.abs(weights), axis=0)
          weights = weights / np.sum(weights)
  
          traces.append(
              go.Bar(
                  name=comp_name,
                  x=lags_range,
                  y=weights,
                  marker_color=color,
              )
          )
  
      else:
          if len(weights.shape) == 2:
              weights = weights[focus - 1, :]
  
          traces.append(
              go.Bar(
                  name=comp_name,
                  x=lags_range,
                  y=weights,
                  marker_color=color,
                  width=0.8,
              )
          )
  
      padded_range = get_dynamic_axis_range(
          lags_range, type="numeric", inverse=True
      )
      xaxis = go.layout.XAxis(
          title=f"{comp_name} lag number", range=padded_range
      )
  
      if focus is None:
          yaxis = go.layout.YAxis(
              rangemode="normal",
              title=go.layout.yaxis.Title(
                  text=f"{comp_name} relevance"
              ),
              tickformat=",.0%",
          )
          # ax = set_y_as_percent(ax)
      else:
          yaxis = go.layout.YAxis(
              rangemode="normal",
              title=go.layout.yaxis.Title(
                  text=f"{comp_name} weight ({focus})-ahead"
              ),
          )
  
      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 5 for calling a global function with example usage: plot_lagged_weights(weights, comp_name, focus) and returns: dict