code: def _test_returns_beyond_treasury(self):
      # The last treasury value is used when return dates go beyond
      # treasury curve data
      treasury_curves = self.env.treasury_curves
      treasury = treasury_curves[
          treasury_curves.index < self.start_session
      ]
  
      test_period = RiskMetricsPeriod(
          start_session=self.start_session,
          end_session=self.end_session,
          returns=self.algo_returns,
          benchmark_returns=self.benchmark_returns,
          trading_calendar=self.trading_calendar,
          treasury_curves=treasury,
          algorithm_leverages=[0.01, 0.02, 0.03],
      )
      assert test_period.treasury_curves.equals(treasury[-1:])
      # This return period has a list instead of None for algorithm_leverages
      # Confirm that max_leverage is set to the max of those values
      assert test_period.max_leverage == 0.03
  
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 23 for calling the TestRisk obj's underlying member method code with example usage: obj._test_returns_beyond_treasury() without return types