code: def test_scaled_interval_score():
      for label in TIME_SERIES:
          for forecast in TIME_SERIES:
              alpha = 0.05
  
              # to keep things simple, the following values are rather arbitrary
              lower_quantile = forecast * (alpha / 2)
              upper_quantile = forecast * (1 - alpha / 2)
  
              # applying `seasonal_error` on the label is not realistic but
              # at least, the seasonal error function gets used this way
              seasonal_err = seasonal_error(label, seasonality=2)
  
              data = {
                  "label": label,
                  "mean": forecast,
                  "seasonal_error": seasonal_err,
                  "0.025": lower_quantile,
                  "0.975": upper_quantile,
              }
  
              actual = scaled_interval_score(data, alpha=alpha)
              expected = (
                  upper_quantile
                  - lower_quantile
                  + 2.0
                  / alpha
                  * (lower_quantile - label)
                  * (label < lower_quantile)
                  + 2.0
                  / alpha
                  * (label - upper_quantile)
                  * (label > upper_quantile)
              ) / seasonal_err
  
              np.testing.assert_almost_equal(actual, expected)
  
file_path: gluonts/test/ev/test_stats.py
imports: import numpy
  from gluonts.ev.stats import absolute_error, absolute_label, absolute_percentage_error, coverage, error, quantile_loss, squared_error, symmetric_absolute_percentage_error, scaled_interval_score, absolute_scaled_error, scaled_quantile_loss
  from gluonts.ev.ts_stats import seasonal_error
label_desc: Use image node_id 9 for calling a global function with example usage: test_scaled_interval_score() without return types