class_docstr: Abstract commission model interface.
  
  Commission models are responsible for accepting order/transaction pairs and
  calculating how much commission should be charged to an algorithm's account
  on each transaction.
class_docstr_tok: ["Abstract","commission","model","interface",".","Commission","models","are","responsible","for","accepting","order\/transaction","pairs","and","calculating","how","much","commission","should","be","charged","to","an","algorithm","'s","account","on","each","transaction","."]
docstr: Calculate the amount of commission to charge on ``order`` as a result
  of ``transaction``.
  
  Parameters
  ----------
  order : catalyst.finance.order.Order
      The order being processed.
  
      The ``commission`` field of ``order`` is a float indicating the
      amount of commission already charged on this order.
  
  transaction : catalyst.finance.transaction.Transaction
      The transaction being processed. A single order may generate
      multiple transactions if there isn't enough volume in a given bar
      to fill the full amount requested in the order.
  
  Returns
  -------
  amount_charged : float
      The additional commission, in dollars, that we should attribute to
      this order.
docstr_tok: ["Calculate","the","amount","of","commission","to","charge","on","``","order","``","as","a","result","of","``","transaction","``",".","Parameters","--","--","--","--","--","order",":","catalyst.finance.order.Order","The","order","being","processed",".","The","``","commission","``","field","of","``","order","``","is","a","float","indicating","the","amount","of","commission","already","charged","on","this","order",".","transaction",":","catalyst.finance.transaction.Transaction","The","transaction","being","processed",".","A","single","order","may","generate","multiple","transactions","if","there","is","n't","enough","volume","in","a","given","bar","to","fill","the","full","amount","requested","in","the","order",".","Returns","--","--","--","-","amount_charged",":","float","The","additional","commission",",","in","dollars",",","that","we","should","attribute","to","this","order","."]
code: def calculate(self, order, transaction):
      """
      Calculate the amount of commission to charge on ``order`` as a result
      of ``transaction``.
  
      Parameters
      ----------
      order : catalyst.finance.order.Order
          The order being processed.
  
          The ``commission`` field of ``order`` is a float indicating the
          amount of commission already charged on this order.
  
      transaction : catalyst.finance.transaction.Transaction
          The transaction being processed. A single order may generate
          multiple transactions if there isn't enough volume in a given bar
          to fill the full amount requested in the order.
  
      Returns
      -------
      amount_charged : float
          The additional commission, in dollars, that we should attribute to
          this order.
      """
      raise NotImplementedError("calculate")
  
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 1 for calling the CommissionModel obj's underlying member method code with example usage: obj.calculate(order, transaction) without return types