code: def test_quantile_loss(self):
      # deterministic not supported
      with pytest.raises(ValueError):
          metrics.quantile_loss(self.series1, self.series1)
  
      # general univariate, multivariate and multi-ts tests
      self.helper_test_multivariate_duplication_equality(
          metrics.quantile_loss, is_stochastic=True
      )
      self.helper_test_multiple_ts_duplication_equality(
          metrics.quantile_loss, is_stochastic=True
      )
      self.helper_test_nan(metrics.quantile_loss, is_stochastic=True)
  
      # test perfect predictions -> risk = 0
      for tau in [0.25, 0.5]:
          assert (
              round(
                  abs(
                      metrics.quantile_loss(
                          self.series1,
                          self.series11_stochastic,
                          tau=tau,
                      )
                      - 0.0
                  ),
                  7,
              )
              == 0
          )
  
      # test whether stochastic sample from two TimeSeries (ts) represents the individual ts at 0. and 1. quantiles
      s1 = self.series1
      s2 = self.series1 * 2
      s12_stochastic = TimeSeries.from_times_and_values(
          s1.time_index, np.stack([s1.values(), s2.values()], axis=2)
      )
      assert (
          round(metrics.quantile_loss(s1, s12_stochastic, tau=1.0), 7)
          == 0
      )
      assert (
          round(metrics.quantile_loss(s2, s12_stochastic, tau=0.0), 7)
          == 0
      )
  
imports: import numpy
  import pandas
  import pytest
  from darts import TimeSeries
  from darts.metrics import metrics
label_desc: Use image node_id 21 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_quantile_loss() without return types