(E, transactions)
return stock_blocks
Converts a list of StockTransactions (which in xml are entity items)
    to lists inside of balance or transfer blocks, depending on their types
Converts a list of StockTransactions (which in xml are entity items)
    to lists inside of balance or transfer blocks, depending on their types
Converts a list of StockTransactions ( which in xml are entity items ) to lists inside of balance or transfer blocks depending on their types
def convert_transactions_to_blocks(E, transactions):
    """
    Converts a list of StockTransactions (which in xml are entity items)
    to lists inside of balance or transfer blocks, depending on their types
    """

    verify_transaction_cases(transactions)

    balances, transfers = process_transactions(E, transactions)

    stock_blocks = []
    if transfers:
        stock_blocks.append(transfers)
    if balances:
        stock_blocks.append(balances)

    return stock_blocks
def convert_transactions_to_blocks ( E , transactions ) : verify_transaction_cases ( transactions ) balances , transfers = process_transactions ( E , transactions ) stock_blocks = [ ] if transfers : stock_blocks . append ( transfers ) if balances : stock_blocks . append ( balances ) return stock_blocks