class_docstr: Abstract base class for commission models.
  
  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.
  
  To implement a new commission model, create a subclass of
  :class:`~zipline.finance.commission.CommissionModel` and implement
  :meth:`calculate`.
class_docstr_tok: ["Abstract","base","class","for","commission","models",".","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",".","To","implement","a","new","commission","model",",","create","a","subclass","of",":","class",":","`","~zipline.finance.commission.CommissionModel","`","and","implement",":","meth",":","`","calculate","`","."]
docstr: Calculate the amount of commission to charge on ``order`` as a result
  of ``transaction``.
  
  Parameters
  ----------
  order : zipline.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 : zipline.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.
code: def calculate(self, order, transaction):
      """
      Calculate the amount of commission to charge on ``order`` as a result
      of ``transaction``.
  
      Parameters
      ----------
      order : zipline.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 : zipline.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 zipline.assets import Equity, Future
  from zipline.finance.constants import FUTURE_EXCHANGE_FEES_BY_SYMBOL
  from zipline.finance.shared import AllowedAssetMarker, FinancialModelMeta
  from zipline.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