code: def test_cumulative_returns(
      self, returns, ret_freq, period_len, expected_vals
  ):
      if "CD" in ret_freq:
          ret_freq_class = CDay(weekmask="Tue Wed Thu Fri Sun")
          ret_freq = ret_freq_class
      elif "B" in ret_freq:
          ret_freq_class = BDay()
      else:
          ret_freq_class = Day()
  
      period_len = Timedelta(period_len)
      index = date_range(
          "1/1/1999", periods=len(returns), freq=ret_freq
      )
      returns = Series(returns, index=index)
  
      cum_ret = cumulative_returns(returns)
  
      expected = Series(expected_vals, index=cum_ret.index)
  
      assert_series_equal(cum_ret, expected, check_less_precise=True)
  
imports: from __future__ import division
  from unittest import TestCase
  from parameterized import parameterized
  from numpy import nan
  from pandas import Series, DataFrame, date_range, MultiIndex, Int64Index, Index, DatetimeIndex, Timedelta
  from pandas.tseries.offsets import BDay, Day, CDay
  from pandas.util.testing import assert_frame_equal, assert_series_equal
  from ..performance import factor_information_coefficient, mean_information_coefficient, mean_return_by_quantile, quantile_turnover, factor_rank_autocorrelation, factor_returns, factor_alpha_beta, cumulative_returns, factor_weights, common_start_returns, average_cumulative_return_by_quantile
  from ..utils import get_forward_returns_columns, get_clean_factor_and_forward_returns
label_desc: Use image node_id 8 for calling the PerformanceTestCase obj's underlying member method code with example usage: obj.test_cumulative_returns(returns, ret_freq, period_len, expected_vals) without return types