code: def plot_nonconformity_scores(
      scores, alpha, q, method, resampler_active=False
  ):
      """Plot the NeuralProphet forecast components.
  
      Parameters
      ----------
          scores : dict
              nonconformity scores
          alpha : float
              user-specified significance level of the prediction interval
          q : float or list
              prediction interval width (or q) for symmetric prediction interval or
              for upper and lower prediction interval, respectively
          method : str
              name of conformal prediction technique used
  
              Options
                  * (default) ``naive``: Naive or Absolute Residual
                  * ``cqr``: Conformalized Quantile Regression
          resampler_active : bool
              Flag whether to activate the plotly-resampler
  
      Returns
      -------
          plotly.graph_objects.Figure
              Figure showing the nonconformity score with horizontal line for q-value based on the significance level or
              alpha
      """
      if resampler_active:
          register_plotly_resampler(mode="auto")
      else:
          unregister_plotly_resampler()
      if not isinstance(q, list):
          q_sym = q
          scores = scores["noncon_scores"]
          confidence_levels = np.arange(len(scores)) / len(scores)
          fig = px.line(
              pd.DataFrame(
                  {
                      "Confidence Level": confidence_levels,
                      "One-Sided Interval Width": scores,
                  }
              ),
              x="Confidence Level",
              y="One-Sided Interval Width",
              title=f"{method} One-Sided Interval Width with q",
              width=600,
              height=400,
          )
          fig.add_vline(
              x=1 - alpha,
              annotation_text=f"(1-alpha) = {1 - alpha}",
              annotation_position="top left",
              line_width=1,
              line_color="green",
          )
          fig.add_hline(
              y=q,
              annotation_text=f"q1 = {round(q_sym, 2)}",
              annotation_position="top left",
              line_width=1,
              line_color="red",
          )
          fig.update_layout(margin=dict(l=70, r=70, t=60, b=50))
          return fig
      else:
          q_lo, q_hi = q
          scores_lo = scores["noncon_scores_lo"]
          scores_hi = scores["noncon_scores_hi"]
          alpha_lo, alpha_hi = alpha
          confidence_levels = np.arange(len(scores_lo)) / len(scores_lo)
          fig = px.line(
              pd.DataFrame(
                  {
                      "Confidence Level": confidence_levels,
                      "One-Sided Lower Interval Width": scores_lo,
                      "One-Sided Upper Interval Width": scores_hi,
                  }
              ),
              x="Confidence Level",
              y=[
                  "One-Sided Lower Interval Width",
                  "One-Sided Upper Interval Width",
              ],
              title=f"{method} One-Sided Interval Width with q",
              width=600,
              height=400,
          )
          fig.add_vline(
              x=1 - alpha_lo,
              annotation_text=f"(1-alpha) = {round(1-alpha_lo, 10)}",
              annotation_position="top left",
              line_width=1,
              line_color="green",
          )
          fig.add_vline(
              x=1 - alpha_hi,
              annotation_text=f"(1-alpha) = {round(1 - alpha_hi, 10)}",
              annotation_position="bottom left",
              line_width=1,
              line_color="green",
          )
          fig.add_hline(
              y=q_lo,
              annotation_text=f"q1_lo = {round(q_lo, 2)}",
              annotation_position="top left",
              line_width=1,
              line_color="red",
          )
          fig.add_hline(
              y=q_hi,
              annotation_text=f"q1_hi = {round(q_hi, 2)}",
              annotation_position="bottom left",
              line_width=1,
              line_color="red",
          )
          fig.update_layout(margin=dict(l=70, r=70, t=60, b=50))
          unregister_plotly_resampler()
          return fig
  
file_path: neural_prophet/neuralprophet/plot_forecast_plotly.py
imports: import logging
  import numpy
  import pandas
  from neuralprophet.plot_model_parameters_plotly import get_dynamic_axis_range
  from neuralprophet.plot_utils import set_y_as_percent
label_desc: Use image node_id 6 for calling a global function with example usage: plot_nonconformity_scores(scores, alpha, q, method, resampler_active) and returns: fig, fig