code: def test_cancel(self):
      blotter = SimulationBlotter()
  
      oid_1 = blotter.order(self.asset_24, 100, MarketOrder())
      oid_2 = blotter.order(self.asset_24, 200, MarketOrder())
      oid_3 = blotter.order(self.asset_24, 300, MarketOrder())
  
      # Create an order for another asset to verify that we don't remove it
      # when we do cancel_all on 24.
      blotter.order(self.asset_25, 150, MarketOrder())
  
      self.assertEqual(len(blotter.open_orders), 2)
      self.assertEqual(len(blotter.open_orders[self.asset_24]), 3)
      self.assertEqual(
          [o.amount for o in blotter.open_orders[self.asset_24]],
          [100, 200, 300],
      )
  
      blotter.cancel(oid_2)
      self.assertEqual(len(blotter.open_orders), 2)
      self.assertEqual(len(blotter.open_orders[self.asset_24]), 2)
      self.assertEqual(
          [o.amount for o in blotter.open_orders[self.asset_24]],
          [100, 300],
      )
      self.assertEqual(
          [o.id for o in blotter.open_orders[self.asset_24]],
          [oid_1, oid_3],
      )
  
      blotter.cancel_all_orders_for_asset(self.asset_24)
      self.assertEqual(len(blotter.open_orders), 1)
      self.assertEqual(list(blotter.open_orders), [self.asset_25])
  
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 6 for calling the BlotterTestCase obj's underlying member method code with example usage: obj.test_cancel() without return types