code: def test_invalid_task_done_raises_errors(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()
  
      # Enqueue t1, but calling `task_done` raises error since t1 is not dequeued.
      self.assertTrue(tq.enqueue(t1))
      with self.assertRaisesRegex(RuntimeError, "Must call `dequeue`"):
          tq.task_done(t1)
  
      # `task_done` succeeds after dequeueing.
      self.assertEqual(t1, tq.dequeue())
      tq.task_done(t1)
  
      # Error since t2 is not in the queue.
      with self.assertRaisesRegex(RuntimeError, "Task not present"):
          tq.task_done(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 2 for calling the TaskQueueTest obj's underlying member method code with example usage: obj.test_invalid_task_done_raises_errors() without return types