"""Input checks carried over from a command line wrapper. One function opens with a bare assert, which is the shape the explicit raise pattern rewrites. The other asserts further down, where rewriting it would change what the function checks first, so the pattern refuses it. """ def open_ticket(queue_name): assert queue_name, "queue name is required" return {"queue": queue_name, "opened": True} def close_ticket(ticket): ticket = dict(ticket) ticket["opened"] = False assert ticket.get("queue"), "queue name is required" return ticket