code: def testMigrateExecutorOutputDirFromStatefulWorkingDir(self):
      existing_file = "already_exists.txt"
      existing_file_text = "already_written"
      files = ["foo.txt", "bar.txt", "path/to/qux.txt", existing_file]
      data = ["foo", "bar", "qux", "should_not_be_written"]
      expected_data = ["foo", "bar", "qux", existing_file_text]
  
      tmpdir = self.create_tempdir()
      stateful_working_dir = os.path.join(
          tmpdir.full_path, "stateful_working_dir"
      )
      for file, datum in zip(files, data):
          stateful_working_file = os.path.join(
              stateful_working_dir, file
          )
          fileio.makedirs(os.path.dirname(stateful_working_file))
          with fileio.open(stateful_working_file, "w") as f:
              f.write(datum)
  
      executor_output = os.path.join(
          tmpdir.full_path, "executor_output"
      )
      executor_output_file_uri = os.path.join(
          executor_output, "foobar.pbtxt"
      )
      fileio.makedirs(executor_output)
      # Test when there's an existing file in the executor output dir
      with fileio.open(
          os.path.join(executor_output, existing_file), "w"
      ) as f:
          f.write(existing_file_text)
  
      exec_info = data_types.ExecutionInfo(
          stateful_working_dir=stateful_working_dir,
          execution_output_uri=executor_output_file_uri,
      )
      outputs_utils.migrate_executor_output_dir_from_stateful_working_directory(
          exec_info, files
      )
  
      for file, datum in zip(files, expected_data):
          with self.subTest(f"Check {file}"):
              with fileio.open(
                  os.path.join(executor_output, file), "r"
              ) as f:
                  actual_datum = f.read()
              self.assertEqual(actual_datum, datum)
  
imports: import os
  from unittest import mock
  from absl.testing import parameterized
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.orchestration import data_types_utils
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.portable import data_types
  from tfx.orchestration.portable import outputs_utils
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact
  from tfx.types import standard_artifacts
  from tfx.types.value_artifact import ValueArtifact
  from tfx.utils import test_case_utils
  from google.protobuf import text_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 5 for calling the OutputUtilsTest obj's underlying member method code with example usage: obj.testMigrateExecutorOutputDirFromStatefulWorkingDir() without return types