class_docstr: Calculates a commission for a transaction based on a per trade cost.
  
  Parameters
  ----------
  cost : float, optional
      The flat amount of commissions paid per equity trade.
class_docstr_tok: ["Calculates","a","commission","for","a","transaction","based","on","a","per","trade","cost",".","Parameters","--","--","--","--","--","cost",":","float",",","optional","The","flat","amount","of","commissions","paid","per","equity","trade","."]
docstr: If the order hasn't had a commission paid yet, pay the fixed
  commission.
docstr_tok: ["If","the","order","has","n't","had","a","commission","paid","yet",",","pay","the","fixed","commission","."]
code: def calculate(self, order, transaction):
      """
      If the order hasn't had a commission paid yet, pay the fixed
      commission.
      """
      if order.commission == 0:
          # if the order hasn't had a commission attributed to it yet,
          # that's what we need to pay.
          return self.cost
      else:
          # order has already had commission attributed, so no more
          # commission.
          return 0.0
  
imports: from abc import abstractmethod
  from collections import defaultdict
  from six import with_metaclass
  from toolz import merge
  from catalyst.assets import Equity, Future
  from catalyst.finance.constants import FUTURE_EXCHANGE_FEES_BY_SYMBOL
  from catalyst.finance.shared import AllowedAssetMarker, FinancialModelMeta
  from catalyst.utils.dummy import DummyMapping
label_desc: Use image node_id 3 for calling the PerTrade obj's underlying member method code with example usage: obj.calculate(order, transaction) and returns: self, int