code: def __test_impl(self, action):
      order = backtesting.MarketOrder(
          action,
          BaseTestCase.TestInstrument,
          25,
          False,
          broker.IntegerTraits(),
      )
      price = 10
      volumeUsed = 0
  
      # Try the order once.
      slippedPrice = self.slippage.calculatePrice(
          order,
          price,
          order.getQuantity(),
          self.barsBuilder.nextBar(10, 11, 9, 10, volume=100),
          volumeUsed,
      )
      quantity = order.getQuantity()
      expectedPriceImpactPct = (
          quantity / 100.0 * quantity / 100.0 * self.priceImpact
      )
      self.assertEqual(expectedPriceImpactPct, 0.00625)
      if action == broker.Order.Action.BUY:
          self.assertEqual(
              slippedPrice, price * (1 + expectedPriceImpactPct)
          )
      else:
          self.assertEqual(
              slippedPrice, price * (1 - expectedPriceImpactPct)
          )
  
      # Try the same order once again.
      volumeUsed += quantity
      quantity += order.getQuantity()
  
      slippedPrice = self.slippage.calculatePrice(
          order,
          price,
          order.getQuantity(),
          self.barsBuilder.nextBar(10, 11, 9, 10, volume=100),
          volumeUsed,
      )
      expectedPriceImpactPct = (
          quantity / 100.0 * quantity / 100.0 * self.priceImpact
      )
      self.assertEqual(expectedPriceImpactPct, 0.025)
      if action == broker.Order.Action.BUY:
          self.assertEqual(
              slippedPrice, price * (1 + expectedPriceImpactPct)
          )
      else:
          self.assertEqual(
              slippedPrice, price * (1 - expectedPriceImpactPct)
          )
  
imports: import unittest
  from .None import broker_backtesting_test
  from pyalgotrade import broker
  from pyalgotrade.broker import slippage
  from pyalgotrade.broker import backtesting
  from pyalgotrade import bar
label_desc: Use image node_id 2 for calling the VolumeShareSlippageTestCase obj's underlying member method code with example usage: obj.__test_impl(action) without return types