code: def test_simple_transforms(self):
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("ignore", PerformanceWarning)
          warnings.simplefilter("default", ZiplineDeprecationWarning)
  
          sim_params = SimulationParameters(
              start_session=self.sim_params.sessions[8],
              end_session=self.sim_params.sessions[-1],
              data_frequency="minute",
              trading_calendar=self.trading_calendar,
          )
  
          algo = self.create_algo(
              simple_transforms_algo, sim_params=sim_params
          )
          algo.run()
  
          self.assertEqual(8, len(w))
          transforms = ["mavg", "vwap", "stddev", "returns"]
  
          for idx, line_no in enumerate(range(8, 12)):
              warning1 = w[idx * 2]
              warning2 = w[(idx * 2) + 1]
  
              self.assertEqual("<string>", warning1.filename)
              self.assertEqual("<string>", warning2.filename)
  
              self.assertEqual(line_no, warning1.lineno)
              self.assertEqual(line_no, warning2.lineno)
  
              self.assertEqual(
                  "`data[sid(N)]` is deprecated. Use "
                  "`data.current`.",
                  str(warning1.message),
              )
              self.assertEqual(
                  "The `{0}` method is "
                  "deprecated.".format(transforms[idx]),
                  str(warning2.message),
              )
  
          # now verify the transform values
          # minute price
          # 2016-01-11 14:31:00+00:00    1561
          # ...
          # 2016-01-14 20:59:00+00:00    3119
          # 2016-01-14 21:00:00+00:00    3120
          # 2016-01-15 14:31:00+00:00    3121
          # 2016-01-15 14:32:00+00:00    3122
          # 2016-01-15 14:33:00+00:00    3123
  
          # volume
          # 2016-01-11 14:31:00+00:00    156100
          # ...
          # 2016-01-14 20:59:00+00:00    311900
          # 2016-01-14 21:00:00+00:00    312000
          # 2016-01-15 14:31:00+00:00    312100
          # 2016-01-15 14:32:00+00:00    312200
          # 2016-01-15 14:33:00+00:00    312300
  
          # daily price (last day built with minute data)
          # 2016-01-14 00:00:00+00:00       9
          # 2016-01-15 00:00:00+00:00    3123
  
          # mavg = average of all the prices = (1561 + 3123) / 2 = 2342
          # vwap = sum(price * volume) / sum(volumes)
          #      = 889119531400.0 / 366054600.0
          #      = 2428.9259891830343
          # stddev = stddev(price, ddof=1) = 451.3435498597493
          # returns = (todayprice - yesterdayprice) / yesterdayprice
          #         = (3123 - 9) / 9 = 346
          self.assertEqual(2342, algo.mavg)
          self.assertAlmostEqual(2428.92599, algo.vwap, places=5)
          self.assertAlmostEqual(451.34355, algo.stddev, places=5)
          self.assertAlmostEqual(346, algo.returns)
  
imports: import warnings
  from mock import patch
  import numpy
  import pandas
  from pandas.core.common import PerformanceWarning
  from zipline.finance.trading import SimulationParameters
  from zipline.testing import MockDailyBarReader, create_daily_df_for_asset, create_minute_df_for_asset, str_to_seconds
  from zipline.testing.fixtures import WithCreateBarData, WithMakeAlgo, ZiplineTestCase
  from zipline.zipline_warnings import ZiplineDeprecationWarning
label_desc: Use image node_id 13 for calling the TestAPIShim obj's underlying member method code with example usage: obj.test_simple_transforms() without return types