code: def test_task_queue_operations(self):
      t1 = _test_task(node_id="trainer", pipeline_id="my_pipeline")
      t2 = _test_task(node_id="transform", pipeline_id="my_pipeline")
      tq = task_queue.TaskQueue()
  
      # Enqueueing new tasks is successful.
      self.assertTrue(tq.enqueue(t1))
      self.assertTrue(tq.enqueue(t2))
  
      # Re-enqueueing the same tasks fails.
      self.assertFalse(tq.enqueue(t1))
      self.assertFalse(tq.enqueue(t2))
  
      # Dequeue succeeds and returns `None` when queue is empty.
      self.assertEqual(t1, tq.dequeue())
      self.assertEqual(t2, tq.dequeue())
      self.assertIsNone(tq.dequeue())
      self.assertIsNone(tq.dequeue(0.1))
  
      # Re-enqueueing the same tasks fails as `task_done` has not been called.
      self.assertFalse(tq.enqueue(t1))
      self.assertFalse(tq.enqueue(t2))
  
      tq.task_done(t1)
      tq.task_done(t2)
  
      # Re-enqueueing is allowed after `task_done` has been called.
      self.assertTrue(tq.enqueue(t1))
      self.assertTrue(tq.enqueue(t2))
  
file_path: tfx/tfx/orchestration/experimental/core/task_queue_test.py
imports: import tensorflow
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_queue
  from tfx.orchestration.experimental.core import test_utils
  from tfx.utils import test_case_utils
label_desc: Use image node_id 1 for calling the TaskQueueTest obj's underlying member method code with example usage: obj.test_task_queue_operations() without return types