<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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)
            )
        }