class_docstr: The ledger tracks all orders and transactions as well as the current
  state of the portfolio and positions.
  
  Attributes
  ----------
  portfolio : zipline.protocol.Portfolio
      The updated portfolio being managed.
  account : zipline.protocol.Account
      The updated account being managed.
  position_tracker : PositionTracker
      The current set of positions.
  todays_returns : float
      The current day's returns. In minute emission mode, this is the partial
      day's returns. In daily emission mode, this is
      ``daily_returns[session]``.
  daily_returns_series : pd.Series
      The daily returns series. Days that have not yet finished will hold
      a value of ``np.nan``.
  daily_returns_array : np.ndarray
      The daily returns as an ndarray. Days that have not yet finished will
      hold a value of ``np.nan``.
class_docstr_tok: ["The","ledger","tracks","all","orders","and","transactions","as","well","as","the","current","state","of","the","portfolio","and","positions",".","Attributes","--","--","--","--","--","portfolio",":","zipline.protocol.Portfolio","The","updated","portfolio","being","managed",".","account",":","zipline.protocol.Account","The","updated","account","being","managed",".","position_tracker",":","PositionTracker","The","current","set","of","positions",".","todays_returns",":","float","The","current","day","'s","returns",".","In","minute","emission","mode",",","this","is","the","partial","day","'s","returns",".","In","daily","emission","mode",",","this","is","``","daily_returns","[","session","]","``",".","daily_returns_series",":","pd.Series","The","daily","returns","series",".","Days","that","have","not","yet","finished","will","hold","a","value","of","``","np.nan","``",".","daily_returns_array",":","np.ndarray","The","daily","returns","as","an","ndarray",".","Days","that","have","not","yet","finished","will","hold","a","value","of","``","np.nan","``","."]
docstr: Process dividends for the next session.
  
  This will earn us any dividends whose ex-date is the next session as
  well as paying out any dividends whose pay-date is the next session
docstr_tok: ["Process","dividends","for","the","next","session",".","This","will","earn","us","any","dividends","whose","ex-date","is","the","next","session","as","well","as","paying","out","any","dividends","whose","pay-date","is","the","next","session"]
code: def process_dividends(
      self, next_session, asset_finder, adjustment_reader
  ):
      """Process dividends for the next session.
  
      This will earn us any dividends whose ex-date is the next session as
      well as paying out any dividends whose pay-date is the next session
      """
      position_tracker = self.position_tracker
  
      # Earn dividends whose ex_date is the next trading day. We need to
      # check if we own any of these stocks so we know to pay them out when
      # the pay date comes.
      held_sids = set(position_tracker.positions)
      if held_sids:
          cash_dividends = adjustment_reader.get_dividends_with_ex_date(
              held_sids, next_session, asset_finder
          )
          stock_dividends = (
              adjustment_reader.get_stock_dividends_with_ex_date(
                  held_sids, next_session, asset_finder
              )
          )
  
          # Earning a dividend just marks that we need to get paid out on
          # the dividend's pay-date. This does not affect our cash yet.
          position_tracker.earn_dividends(
              cash_dividends,
              stock_dividends,
          )
  
      # Pay out the dividends whose pay-date is the next session. This does
      # affect out cash.
      self._cash_flow(
          position_tracker.pay_dividends(
              next_session,
          ),
      )
  
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 16 for calling the Ledger obj's underlying member method code with example usage: obj.process_dividends(next_session, asset_finder, adjustment_reader) without return types