code: def test_algorithm_leverages(self):
      # Max leverage for an algorithm with 'None' as leverage is 0.
      for period, expected_len in zip(PERIODS, [12, 10, 7, 1]):
          self.assertEqual(
              [x["max_leverage"] for x in self.metrics[period]],
              [0.0] * expected_len,
          )
  
      test_period = ClassicRiskMetrics.risk_metric_period(
          start_session=self.start_session,
          end_session=self.end_session,
          algorithm_returns=self.algo_returns,
          benchmark_returns=self.benchmark_returns,
          algorithm_leverages=pd.Series([0.01, 0.02, 0.03]),
      )
  
      # This return period has a list instead of None for algorithm_leverages
      # Confirm that max_leverage is set to the max of those values
      self.assertEqual(test_period["max_leverage"], 0.03)
  
imports: import datetime
  import pandas
  import numpy
  from zipline.utils import factory
  from zipline.finance.trading import SimulationParameters
  import zipline.testing.fixtures
  from zipline.finance.metrics import _ClassicRiskMetrics
label_desc: Use image node_id 19 for calling the TestRisk obj's underlying member method code with example usage: obj.test_algorithm_leverages() without return types