def PrintPosition(pos, with_returns=False):
 print '    Position      :', pos.position_title
 print '    Ticker ID     :', pos.ticker_id
 print '    Symbol        :', pos.symbol
 print '    Last updated  :', pos.updated.text
 d = pos.position_data
 print '    Shares        :', d.shares
 if with_returns:
  print '    Gain %        :', d.gain_percentage
  PrRtn('    Returns       :', d)
  print '    Cost basis    :', d.cost_basis
  print '    Days gain     :', d.days_gain
  print '    Gain          :', d.gain
  print '    Market value  :', d.market_value
 print
 if pos.transactions:
  print '    <inlined transactions>\n'
  PrintTransactions(pos.transactions)
  print '    </inlined transactions>\n'

def PrintPosition ( pos , with_returns = False ) : print '    Position      :' , pos . position_title print '    Ticker ID     :' , pos . ticker_id print '    Symbol        :' , pos . symbol print '    Last updated  :' , pos . updated . text d = pos . position_data print '    Shares        :' , d . shares if with_returns : print '    Gain %        :' , d . gain_percentage PrRtn ( '    Returns       :' , d ) print '    Cost basis    :' , d . cost_basis print '    Days gain     :' , d . days_gain print '    Gain          :' , d . gain print '    Market value  :' , d . market_value print if pos . transactions : print '    <inlined transactions>\n' PrintTransactions ( pos . transactions ) print '    </inlined transactions>\n'
print single position .