class_docstr: Calculates a commission for a transaction based on a per trade cost.
  
  Parameters
  ----------
  cost : float or dict
      The flat amount of commissions paid per trade, regardless of the number
      of contracts being traded. If given a float, the commission for all
      futures contracts is the same. If given a dictionary, it must map root
      symbols to the commission cost for trading contracts of that symbol.
class_docstr_tok: ["Calculates","a","commission","for","a","transaction","based","on","a","per","trade","cost",".","Parameters","--","--","--","--","--","cost",":","float","or","dict","The","flat","amount","of","commissions","paid","per","trade",",","regardless","of","the","number","of","contracts","being","traded",".","If","given","a","float",",","the","commission","for","all","futures","contracts","is","the","same",".","If","given","a","dictionary",",","it","must","map","root","symbols","to","the","commission","cost","for","trading","contracts","of","that","symbol","."]
code: def __repr__(self):
      if isinstance(self._cost_per_trade, DummyMapping):
          # Cost per trade is a constant, so extract it.
          cost_per_trade = self._cost_per_trade["dummy key"]
      else:
          cost_per_trade = "<varies>"
      return "{class_name}(cost_per_trade={cost_per_trade})".format(
          class_name=self.__class__.__name__,
          cost_per_trade=cost_per_trade,
      )
  
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 2 for calling the PerFutureTrade obj's underlying member method code with example usage: obj.__repr__() and returns: str