code: def get_positions(self):
      positions = self._positions_store
  
      for asset, pos in iteritems(self.positions):
          if pos.amount == 0:
              # Clear out the position if it has become empty since the last
              # time get_positions was called.  Catching the KeyError is
              # faster than checking `if asset in positions`, and this can be
              # potentially called in a tight inner loop.
              try:
                  del positions[asset]
              except KeyError:
                  pass
              continue
  
          position = zp.Position(asset)
          position.amount = pos.amount
          position.cost_basis = pos.cost_basis
          position.last_sale_price = pos.last_sale_price
          position.last_sale_date = pos.last_sale_date
  
          # Adds the new position if we didn't have one before, or overwrite
          # one we have currently
          positions[asset] = position
  
      return positions
  
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 9 for calling the PositionTracker obj's underlying member method code with example usage: obj.get_positions() and returns: positions