code: def update_position(
      self,
      asset,
      amount=None,
      last_sale_price=None,
      last_sale_date=None,
      cost_basis=None,
  ):
      if asset not in self.positions:
          position = Position(asset)
          self.positions[asset] = position
      else:
          position = self.positions[asset]
  
      if amount is not None:
          position.amount = amount
      if last_sale_price is not None:
          position.last_sale_price = last_sale_price
      if last_sale_date is not None:
          position.last_sale_date = last_sale_date
      if cost_basis is not None:
          position.cost_basis = cost_basis
  
imports: from __future__ import division
  import logbook
  import numpy
  from collections import namedtuple
  from math import isnan
  from six import iteritems, itervalues
  from catalyst.finance.performance.position import Position
  from catalyst.finance.transaction import Transaction
  from catalyst.utils.input_validation import expect_types
  import catalyst.protocol
  from catalyst.assets import Future, Asset
  from .position import positiondict
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 2 for calling the PositionTracker obj's underlying member method code with example usage: obj.update_position(asset, amount, last_sale_price, last_sale_date, cost_basis) without return types