code: def _test_algorithm_returns(self):
      np.testing.assert_almost_equal(
          [
              x.algorithm_period_returns
              for x in self.metrics.month_periods
          ],
          [
              (1 + RETURNS_BASE) ** len(x.algorithm_returns) - 1
              for x in self.metrics.month_periods
          ],
          DECIMAL_PLACES,
      )
      np.testing.assert_almost_equal(
          [
              x.algorithm_period_returns
              for x in self.metrics.three_month_periods
          ],
          [
              (1 + RETURNS_BASE) ** len(x.algorithm_returns) - 1
              for x in self.metrics.three_month_periods
          ],
          DECIMAL_PLACES,
      )
      np.testing.assert_almost_equal(
          [
              x.algorithm_period_returns
              for x in self.metrics.six_month_periods
          ],
          [
              (1 + RETURNS_BASE) ** len(x.algorithm_returns) - 1
              for x in self.metrics.six_month_periods
          ],
          DECIMAL_PLACES,
      )
      np.testing.assert_almost_equal(
          [
              x.algorithm_period_returns
              for x in self.metrics.year_periods
          ],
          [
              (1 + RETURNS_BASE) ** len(x.algorithm_returns) - 1
              for x in self.metrics.year_periods
          ],
          DECIMAL_PLACES,
      )
  
imports: import datetime
  import calendar
  import pandas
  import numpy
  import catalyst.finance.risk
  from catalyst.utils import factory
  from catalyst.finance.trading import SimulationParameters
  from catalyst.testing.fixtures import WithTradingEnvironment, CatalystTestCase
  from catalyst.finance.risk.period import RiskMetricsPeriod
label_desc: Use image node_id 7 for calling the TestRisk obj's underlying member method code with example usage: obj._test_algorithm_returns() without return types