for title, batches in items.items():
for batch in batches:
if batch['expiration_date'] and batch['expiration_date'] < today:
expiring_items.append({'title': title, 'expiration_date': batch['expiration_date']})
break # <--- ???