code: def _task_manager(self, task_queue, max_active_task_schedulers=1000):
      # Use TaskManagerE2ETest below if you want to test MLMD integration.
      mlmd_handle = mock.create_autospec(
          metadata.Metadata, instance=True
      )
      mlmd_handle.store.get_executions_by_id.return_value = [
          metadata_store_pb2.Execution()
      ]
      with tm.TaskManager(
          mlmd_handle,
          task_queue,
          max_active_task_schedulers=max_active_task_schedulers,
          max_dequeue_wait_secs=0.1,
          process_all_queued_tasks_before_exit=True,
      ) as task_manager:
          yield task_manager
  
imports: import contextlib
  import functools
  import os
  import threading
  import time
  from absl import logging
  from absl.testing.absltest import mock
  import tensorflow
  from tfx.orchestration import data_types_utils
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import async_pipeline_task_gen
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import post_execution_utils
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_manager
  from tfx.orchestration.experimental.core import task_queue
  from tfx.orchestration.experimental.core import task_scheduler
  from tfx.orchestration.experimental.core import test_utils
  from tfx.orchestration.experimental.core.testing import test_async_pipeline
  from tfx.orchestration import mlmd_connection_manager
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 2 for calling the TaskManagerTest obj's underlying member method code with example usage: obj._task_manager(task_queue, max_active_task_schedulers) without return types