Review a pre-existing pull request for code that posts and retrieves data from an inventory system and determines whether a stream of orders can be processed.
Asked in the Round 3 (PR review) stage. Codility link with PR and explanation; candidate suggested map/switch over if-else chains, renames, schema changes, bulk queries, API batching.
Implement def can_process_orders(inventory, orders):. inventory is a dictionary mapping item names to nonnegative quantities. orders is a list of dictionaries with positive requested quantities. Process orders in order, deducting stock only when every item in the current order is available. Return True if all orders can be processed, otherwise return False.
def can_process_orders(inventory, orders):