class_docstr: The current state of the positions held.
  
  Parameters
  ----------
  data_frequency : {'daily', 'minute'}
      The data frequency of the simulation.
class_docstr_tok: ["The","current","state","of","the","positions","held",".","Parameters","--","--","--","--","--","data_frequency",":","{","'daily","'",",","'minute","'","}","The","data","frequency","of","the","simulation","."]
docstr: Given a list of dividends whose ex_dates are all the next trading
  day, calculate and store the cash and/or stock payments to be paid on
  each dividend's pay date.
  
  Parameters
  ----------
  cash_dividends : iterable of (asset, amount, pay_date) namedtuples
  
  stock_dividends: iterable of (asset, payment_asset, ratio, pay_date)
      namedtuples.
code: def earn_dividends(self, cash_dividends, stock_dividends):
      """Given a list of dividends whose ex_dates are all the next trading
      day, calculate and store the cash and/or stock payments to be paid on
      each dividend's pay date.
  
      Parameters
      ----------
      cash_dividends : iterable of (asset, amount, pay_date) namedtuples
  
      stock_dividends: iterable of (asset, payment_asset, ratio, pay_date)
          namedtuples.
      """
      for cash_dividend in cash_dividends:
          self._dirty_stats = (
              True  # only mark dirty if we pay a dividend
          )
  
          # Store the earned dividends so that they can be paid on the
          # dividends' pay_dates.
          div_owed = self.positions[cash_dividend.asset].earn_dividend(
              cash_dividend,
          )
          try:
              self._unpaid_dividends[cash_dividend.pay_date].append(
                  div_owed
              )
          except KeyError:
              self._unpaid_dividends[cash_dividend.pay_date] = [
                  div_owed
              ]
  
      for stock_dividend in stock_dividends:
          self._dirty_stats = (
              True  # only mark dirty if we pay a dividend
          )
  
          div_owed = self.positions[
              stock_dividend.asset
          ].earn_stock_dividend(stock_dividend)
          try:
              self._unpaid_stock_dividends[
                  stock_dividend.pay_date
              ].append(
                  div_owed,
              )
          except KeyError:
              self._unpaid_stock_dividends[stock_dividend.pay_date] = [
                  div_owed,
              ]
  
imports: from __future__ import division
  from collections import namedtuple, OrderedDict
  from functools import partial
  from math import isnan
  import logbook
  import numpy
  import pandas
  from six import iteritems, itervalues, PY2
  from zipline.assets import Future
  from zipline.finance.transaction import Transaction
  import zipline.protocol
  from zipline.utils.sentinel import sentinel
  from .position import Position
  from ._finance_ext import PositionStats, calculate_position_tracker_stats, update_position_last_sale_prices
label_desc: Use image node_id 6 for calling the PositionTracker obj's underlying member method code with example usage: obj.earn_dividends(cash_dividends, stock_dividends) without return types