original_docstring: 
      split processing - adjust price and quantity of all pre-split transactions
      the double loop is intentional since a stock can split more than once, start processing by earliest date
    
docstring: split processing - adjust price and quantity of all pre-split transactions
  the double loop is intentional since a stock can split more than once, start processing by earliest date
docstring_tokens: split processing - adjust price and quantity of all pre - split transactions the double loop is intentional since a stock can split more than once start processing by earliest date
code: def _apply_splits(parsed, splits):
    """
      split processing - adjust price and quantity of all pre-split transactions
      the double loop is intentional since a stock can split more than once, start processing by earliest date
    """
    
    for split in sorted(splits, key = (lambda split: split.as_of_date)):
      for transaction in parsed:
        if transaction.get('symbol') == split.from_symbol and transaction.get('date') <= split.as_of_date:
          factor = split.to_quantity / split.from_quantity
          transaction['symbol'] = split.to_symbol
          transaction['quantity'] = transaction.get('quantity') * factor
          transaction['price'] = transaction.get('price') / factor
code_tokens: def _apply_splits ( parsed , splits ) : for split in sorted ( splits , key = ( lambda split : split . as_of_date ) ) : for transaction in parsed : if transaction . get ( 'symbol' ) == split . from_symbol and transaction . get ( 'date' ) <= split . as_of_date : factor = split . to_quantity / split . from_quantity transaction [ 'symbol' ] = split . to_symbol transaction [ 'quantity' ] = transaction . get ( 'quantity' ) * factor transaction [ 'price' ] = transaction . get ( 'price' ) / factor
short_docstring: split processing - adjust price and quantity of all pre-split transactions
  the double loop is intentional since a stock can split more than once, start processing by earliest date
short_docstring_tokens: split processing - adjust price and quantity of all pre - split transactions the double loop is intentional since a stock can split more than once start processing by earliest date
comment: """
      split processing - adjust price and quantity of all pre-split transactions
      the double loop is intentional since a stock can split more than once, start processing by earliest date
    """