code: def handle_split(self, asset, ratio):
          
          if self.asset != asset:
              raise Exception("updating split with the wrong asset!")
  
          # adjust the # of shares by the ratio
          # (if we had 100 shares, and the ratio is 3,
          #  we now have 33 shares)
          # (old_share_count / ratio = new_share_count)
          # (old_price * ratio = new_price)
  
          # e.g., 33.333
          raw_share_count = self.amount / float(ratio)
  
          # e.g., 33
          full_share_count = np.floor(raw_share_count)
  
          # e.g., 0.333
          fractional_share_count = raw_share_count - full_share_count
  
          # adjust the cost basis to the nearest cent, e.g., 60.0
          new_cost_basis = round(self.cost_basis * ratio, 2)
  
          self.cost_basis = new_cost_basis
          self.amount = full_share_count
  
          return_cash = round(float(fractional_share_count * new_cost_basis), 2)
  
          log.info("after split: " + str(self))
          log.info("returning cash: " + str(return_cash))
  
          # return the leftover cash, which will be converted into cash
          # (rounded to the nearest cent)
          return return_cash
docs: Update the position by the split ratio, and return the resulting
          fractional share that will be converted into cash.
  
          Returns the unused cash.