code: def test_slippage_and_commission_dispatching(self):
      blotter = SimulationBlotter(
          equity_slippage=FixedSlippage(spread=0.0),
          future_slippage=FixedSlippage(spread=2.0),
          equity_commission=PerTrade(cost=1.0),
          future_commission=PerTrade(cost=2.0),
      )
      blotter.order(self.asset_24, 1, MarketOrder())
      blotter.order(self.future_cl, 1, MarketOrder())
  
      bar_data = self.create_bardata(
          simulation_dt_func=lambda: self.sim_params.sessions[-1],
      )
      txns, commissions, _ = blotter.get_transactions(bar_data)
  
      # The equity transaction should have the same price as its current
      # price because the slippage spread is zero. Its commission should be
      # $1.00.
      equity_txn = txns[0]
      self.assertEqual(
          equity_txn.price,
          bar_data.current(equity_txn.asset, "price"),
      )
      self.assertEqual(commissions[0]["cost"], 1.0)
  
      # The future transaction price should be 1.0 more than its current
      # price because half of the 'future_slippage' spread is added. Its
      # commission should be $2.00.
      future_txn = txns[1]
      self.assertEqual(
          future_txn.price,
          bar_data.current(future_txn.asset, "price") + 1.0,
      )
      self.assertEqual(commissions[1]["cost"], 2.0)
  
imports: from nose_parameterized import parameterized
  import pandas
  from zipline.assets import Equity
  from zipline.finance.blotter import SimulationBlotter
  from zipline.finance.cancel_policy import EODCancel, NeverCancel
  from zipline.finance.commission import PerTrade
  from zipline.finance.execution import LimitOrder, MarketOrder, StopLimitOrder, StopOrder
  from zipline.finance.order import ORDER_STATUS, Order
  from zipline.finance.slippage import DEFAULT_EQUITY_VOLUME_SLIPPAGE_BAR_LIMIT, FixedSlippage, VolumeShareSlippage
  from zipline.gens.sim_engine import BAR, SESSION_END
  from zipline.testing.fixtures import WithCreateBarData, WithDataPortal, WithLogger, WithSimParams, ZiplineTestCase
  from zipline.utils.classproperty import classproperty
label_desc: Use image node_id 13 for calling the BlotterTestCase obj's underlying member method code with example usage: obj.test_slippage_and_commission_dispatching() without return types