docstr: Returns a cash payment based on the dividends that should be paid out
  according to the accumulated bookkeeping of earned, unpaid, and stock
  dividends.
docstr_tok: ["Returns","a","cash","payment","based","on","the","dividends","that","should","be","paid","out","according","to","the","accumulated","bookkeeping","of","earned",",","unpaid",",","and","stock","dividends","."]
code: def pay_dividends(self, next_trading_day):
      """
      Returns a cash payment based on the dividends that should be paid out
      according to the accumulated bookkeeping of earned, unpaid, and stock
      dividends.
      """
      net_cash_payment = 0.0
  
      try:
          payments = self._unpaid_dividends[next_trading_day]
          # Mark these dividends as paid by dropping them from our unpaid
          del self._unpaid_dividends[next_trading_day]
      except KeyError:
          payments = []
  
      # representing the fact that we're required to reimburse the owner of
      # the stock for any dividends paid while borrowing.
      for payment in payments:
          net_cash_payment += payment["amount"]
  
      # Add stock for any stock dividends paid.  Again, the values here may
      # be negative in the case of short positions.
      try:
          stock_payments = self._unpaid_stock_dividends[
              next_trading_day
          ]
      except:
          stock_payments = []
  
      for stock_payment in stock_payments:
          payment_asset = stock_payment["payment_asset"]
          share_count = stock_payment["share_count"]
          # note we create a Position for stock dividend if we don't
          # already own the asset
          if payment_asset in self.positions:
              position = self.positions[payment_asset]
          else:
              position = self.positions[payment_asset] = Position(
                  payment_asset
              )
  
          position.amount += share_count
  
      return net_cash_payment
  
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 7 for calling the PositionTracker obj's underlying member method code with example usage: obj.pay_dividends(next_trading_day) and returns: net_cash_payment