def arrival_delay_greater_than(item_id, delay, namespace="<STR_LIT>"):
expected = get_state(item_id, namespace=namespace)<EOL>now = time.time()<EOL>if expected and (now - expected) > delay:<EOL><INDENT>logger.error("<STR_LIT>", delay)<EOL>return True<EOL><DEDENT>elif expected:<EOL><INDENT>logger.info("<STR_LIT>",<EOL>now, expected, delay)<EOL>return False<EOL><DEDENT>elif delay > <NUM_LIT:0>:<EOL><INDENT>logger.info("<STR_LIT>",<EOL>datetime.fromtimestamp(now).isoformat(), item_id)<EOL>set_state(item_id, now, namespace=namespace)<EOL>return False<EOL><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>")<EOL>return True<EOL><DEDENT>
Check if an item arrival is delayed more than a given amount.