docstr: Register the number of shares we held at this dividend's ex date so
  that we can pay out the correct amount on the dividend's pay date.
docstr_tok: ["Register","the","number","of","shares","we","held","at","this","dividend","'s","ex","date","so","that","we","can","pay","out","the","correct","amount","on","the","dividend","'s","pay","date","."]
code: def earn_stock_dividend(self, stock_dividend):
      """
      Register the number of shares we held at this dividend's ex date so
      that we can pay out the correct amount on the dividend's pay date.
      """
      return {
          "payment_asset": stock_dividend.payment_asset,
          "share_count": np.floor(
              self.amount * float(stock_dividend.ratio)
          ),
      }
  
imports: from __future__ import division
  from math import copysign
  from collections import OrderedDict
  import numpy
  import logbook
  from catalyst.assets import Future, Asset
  from catalyst.utils.input_validation import expect_types
  from catalyst.constants import LOG_LEVEL
label_desc: Use image node_id 3 for calling the Position obj's underlying member method code with example usage: obj.earn_stock_dividend(stock_dividend) and returns: dict