code: def test_rho_risk(self):
      # deterministic not supported
      with pytest.raises(ValueError):
          metrics.rho_risk(self.series1, self.series1)
  
      # general univariate, multivariate and multi-ts tests
      self.helper_test_multivariate_duplication_equality(
          metrics.rho_risk, is_stochastic=True
      )
      self.helper_test_multiple_ts_duplication_equality(
          metrics.rho_risk, is_stochastic=True
      )
      self.helper_test_nan(metrics.rho_risk, is_stochastic=True)
  
      # test perfect predictions -> risk = 0
      for rho in [0.25, 0.5]:
          assert (
              round(
                  abs(
                      metrics.rho_risk(
                          self.series1,
                          self.series11_stochastic,
                          rho=rho,
                      )
                      - 0.0
                  ),
                  7,
              )
              == 0
          )
      assert (
          round(
              abs(
                  metrics.rho_risk(
                      self.series12_mean,
                      self.series12_stochastic,
                      rho=0.5,
                  )
                  - 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(
              abs(metrics.rho_risk(s1, s12_stochastic, rho=0.0) - 0.0),
              7,
          )
          == 0
      )
      assert (
          round(
              abs(metrics.rho_risk(s2, s12_stochastic, rho=1.0) - 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 20 for calling the TestMetrics obj's underlying member method code with example usage: obj.test_rho_risk() without return types