code: def to_dict(self):
      py = copy(self.__dict__)
      del py["type"]
      del py["asset"]
  
      # Adding 'sid' for backwards compatibility with downstrean consumers.
      py["sid"] = self.asset
  
      # If you think this looks dumb, that is because it is! We once stored
      # commission here, but haven't for over a year. I don't want to change
      # the perf packet structure yet.
      py["commission"] = None
  
      return py
  
file_path: zipline/zipline/finance/transaction.py
imports: from __future__ import division
  from copy import copy
  from zipline.assets import Asset
  from zipline.protocol import DATASOURCE_TYPE
  from zipline.utils.input_validation import expect_types
label_desc: Use image node_id 4 for calling the Transaction obj's underlying member method code with example usage: obj.to_dict() and returns: py