class_docstr: Calculates a commission for a transaction based on a per percentage fee.
  
  Parameters
  ----------
  maker : float, optional
      The percentage maker fee.
  
  taker: float, optional
      The percentage taker fee.
class_docstr_tok: ["Calculates","a","commission","for","a","transaction","based","on","a","per","percentage","fee",".","Parameters","--","--","--","--","--","maker",":","float",",","optional","The","percentage","maker","fee",".","taker",":","float",",","optional","The","percentage","taker","fee","."]
docstr: Calculate the final fee based on the order parameters.
  
  :param order: Order
  :param transaction: Transaction
  
  :return float:
      The total commission.
docstr_tok: ["Calculate","the","final","fee","based","on","the","order","parameters",".",":","param","order",":","Order",":","param","transaction",":","Transaction",":","return","float",":","The","total","commission","."]
code: def calculate(self, order, transaction):
      """
      Calculate the final fee based on the order parameters.
  
      :param order: Order
      :param transaction: Transaction
  
      :return float:
          The total commission.
      """
      cost = abs(transaction.amount) * transaction.price
  
      asset = order.asset
      maker, taker = self.get_maker_taker(asset)
  
      multiplier = taker
      if order.limit is not None:
          multiplier = (
              maker
              if (
                  (order.amount > 0 and order.limit < transaction.price)
                  or (
                      order.amount < 0
                      and order.limit > transaction.price
                  )
              )
              and order.limit_reached
              else taker
          )
  
      fee = cost * multiplier
      return fee
  
imports: import numpy
  import pandas
  from logbook import Logger
  from redo import retry
  from catalyst.assets._assets import TradingPair
  from catalyst.constants import LOG_LEVEL
  from catalyst.exchange.exchange_errors import ExchangeRequestError
  from catalyst.finance.blotter import Blotter
  from catalyst.finance.commission import CommissionModel
  from catalyst.finance.order import ORDER_STATUS
  from catalyst.finance.slippage import SlippageModel
  from catalyst.finance.transaction import create_transaction
  from catalyst.utils.input_validation import expect_types
label_desc: Use image node_id 4 for calling the TradingPairFeeSchedule obj's underlying member method code with example usage: obj.calculate(order, transaction) and returns: fee