moderate(review) for dicts with text, rating, verified_purchase, account_age_days. Reject ('reject') when the text is under 10 chars or contains any banned word ('fake', 'scam', 'spam' — case-insensitive). Hold ('hold') 1-2 star ratings from accounts under 7 days old. Everything else: 'approve'.moderate({'text': 'Total scam do not buy', 'rating': 1, 'verified_purchase': True, 'account_age_days': 400})'reject'
The banned word rule fires first.
moderate({'text': 'Decent quality for the price', 'rating': 2, 'account_age_days': 3, 'verified_purchase': False})'hold'
Low rating + brand-new account.
Guard clauses in order: reject, hold, approve.
any(w in text.lower() for w in banned).