code: def check_stocks():
      commission = 0.5
      comm = bt.CommissionInfo(commission=commission)
  
      price = 10.0
      cash = 10000.0
      size = 100.0
  
      opcost = comm.getoperationcost(size=size, price=price)
      assert opcost == size * price
  
      pos = Position(size=size, price=price)
      value = comm.getvalue(pos, price)
      assert value == size * price
  
      commcost = comm.getcommission(size, price)
      assert commcost == size * price * commission
  
      newprice = 5.0
      pnl = comm.profitandloss(pos.size, pos.price, newprice)
      assert pnl == pos.size * (newprice - price)
  
      ca = comm.cashadjust(size, price, newprice)
      assert not ca
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import testcommon
  import backtrader
  from backtrader import CommissionInfo, Position
label_desc: Use image node_id 1 for calling a global function with example usage: check_stocks() without return types