code: def create_transaction(order, dt, price, amount):
      # floor the amount to protect against non-whole number orders
      # TODO: Investigate whether we can add a robust check in blotter
      # and/or tradesimulation, as well.
  
      transaction = Transaction(
          asset=order.asset,
          amount=amount,
          dt=dt,
          price=price,
          order_id=order.id,
      )
  
      return transaction
  
file_path: catalyst/catalyst/finance/transaction.py
imports: from __future__ import division
  from copy import copy
  from catalyst.assets import Asset
  from catalyst.protocol import DATASOURCE_TYPE
  from catalyst.utils.input_validation import expect_types
label_desc: Use image node_id 1 for calling a global function with example usage: create_transaction(order, dt, price, amount) and returns: transaction