docstr: Update the position by the split ratio, and return the resulting
  fractional share that will be converted into cash.
  
  Returns the unused cash.
docstr_tok: ["Update","the","position","by","the","split","ratio",",","and","return","the","resulting","fractional","share","that","will","be","converted","into","cash",".","Returns","the","unused","cash","."]
code: def handle_split(self, asset, ratio):
      """
      Update the position by the split ratio, and return the resulting
      fractional share that will be converted into cash.
  
      Returns the unused cash.
      """
      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
  
file_path: zipline/zipline/finance/position.py
imports: from __future__ import division
  from math import copysign
  import numpy
  import logbook
  from zipline.assets import Future
  import zipline.protocol
label_desc: Use image node_id 6 for calling the Position obj's underlying member method code with example usage: obj.handle_split(asset, ratio) and returns: return_cash