code: def test_invert(mock_order_class, mock_exchange_class):
      # Test Initialization
      criteria = ~Timed(5)
      assert criteria
      assert isinstance(criteria, Criteria)
  
      order = mock_order_class.return_value
      order.created_at = 0
  
      exchange = mock_exchange_class.return_value
  
      order.clock.step = 3
      assert not criteria(order, exchange)
  
      order.clock.step = 5
      assert not criteria(order, exchange)
  
      order.clock.step = 7
      assert criteria(order, exchange)
  
imports: import unittest.mock
  from tensortrade.oms.orders.criteria import Criteria, Limit, Stop, Timed
  from tensortrade.oms.instruments import USD, BTC
  from tensortrade.oms.orders import TradeSide
label_desc: Use image node_id 4 for calling a global function with example usage: test_invert(mock_order_class, mock_exchange_class) without return types