docstr: A note about cost-basis in catalyst: all positions are considered
  to share a cost basis, even if they were executed in different
  transactions with different commission costs, different prices, etc.
  
  Due to limitations about how catalyst handles positions, catalyst will
  currently spread an externally-delivered commission charge across
  all shares in a position.
docstr_tok: ["A","note","about","cost-basis","in","catalyst",":","all","positions","are","considered","to","share","a","cost","basis",",","even","if","they","were","executed","in","different","transactions","with","different","commission","costs",",","different","prices",",","etc",".","Due","to","limitations","about","how","catalyst","handles","positions",",","catalyst","will","currently","spread","an","externally-delivered","commission","charge","across","all","shares","in","a","position","."]
code: def adjust_commission_cost_basis(self, asset, cost):
      """
      A note about cost-basis in catalyst: all positions are considered
      to share a cost basis, even if they were executed in different
      transactions with different commission costs, different prices, etc.
  
      Due to limitations about how catalyst handles positions, catalyst will
      currently spread an externally-delivered commission charge across
      all shares in a position.
      """
  
      if asset != self.asset:
          raise Exception(
              "Updating a commission for a different asset?"
          )
      if cost == 0.0:
          return
  
      # If we no longer hold this position, there is no cost basis to
      # adjust.
      if self.amount == 0:
          return
  
      prev_cost = self.cost_basis * self.amount
      if isinstance(asset, Future):
          cost_to_use = cost / asset.multiplier
      else:
          cost_to_use = cost
      new_cost = prev_cost + cost_to_use
      self.cost_basis = new_cost / self.amount
  
imports: from __future__ import division
  from math import copysign
  from collections import OrderedDict
  import numpy
  import logbook
  from catalyst.assets import Future, Asset
  from catalyst.utils.input_validation import expect_types
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 6 for calling the Position obj's underlying member method code with example usage: obj.adjust_commission_cost_basis(asset, cost) without return types