code: def handle_splits(self, splits):
          
          total_leftover_cash = 0
  
          for asset, ratio in splits:
              if asset in self.positions:
                  self._dirty_stats = True
  
                  # Make the position object handle the split. It returns the
                  # leftover cash from a fractional share, if there is any.
                  position = self.positions[asset]
                  leftover_cash = position.handle_split(asset, ratio)
                  total_leftover_cash += leftover_cash
  
          return total_leftover_cash
docs: Processes a list of splits by modifying any positions as needed.
  
          Parameters
          ----------
          splits: list
              A list of splits.  Each split is a tuple of (asset, ratio).
  
          Returns
          -------
          int: The leftover cash from fractional shares after modifying each
              position.