code: def setUp(self):
      super().setUp()
      self._source_data_dir = os.path.join(
          os.path.dirname(os.path.dirname(__file__)), "testdata"
      )
      self._output_data_dir = os.path.join(
          os.environ.get(
              "TEST_UNDECLARED_OUTPUTS_DIR", self.get_temp_dir()
          ),
          self._testMethodName,
      )
      self.component_id = "test_component"
  
      # Create input dict.
      self._examples = standard_artifacts.Examples()
      unlabelled_path = os.path.join(
          self._source_data_dir, "csv_example_gen", "unlabelled"
      )
      self._examples.uri = os.path.join(
          self._output_data_dir, "csv_example_gen"
      )
      io_utils.copy_dir(
          unlabelled_path,
          os.path.join(self._examples.uri, "Split-unlabelled"),
      )
      io_utils.copy_dir(
          unlabelled_path,
          os.path.join(self._examples.uri, "Split-unlabelled2"),
      )
      self._examples.split_names = artifact_utils.encode_split_names(
          ["unlabelled", "unlabelled2"]
      )
      self._model = standard_artifacts.Model()
      self._model.uri = os.path.join(
          self._source_data_dir, "trainer/current"
      )
  
      self._model_blessing = standard_artifacts.ModelBlessing()
      self._model_blessing.uri = os.path.join(
          self._source_data_dir, "model_validator/blessed"
      )
      self._model_blessing.set_int_custom_property("blessed", 1)
  
      self._input_dict = {
          standard_component_specs.EXAMPLES_KEY: [self._examples],
          standard_component_specs.MODEL_KEY: [self._model],
          standard_component_specs.MODEL_BLESSING_KEY: [
              self._model_blessing
          ],
      }
  
      # Create output dict.
      self._inference_result = standard_artifacts.InferenceResult()
      self._prediction_log_dir = os.path.join(
          self._output_data_dir, "prediction_logs"
      )
      self._inference_result.uri = self._prediction_log_dir
  
      self._output_examples = standard_artifacts.Examples()
      self._output_examples_dir = os.path.join(
          self._output_data_dir, "output_examples"
      )
      self._output_examples.uri = self._output_examples_dir
  
      self._output_dict_ir = {
          standard_component_specs.INFERENCE_RESULT_KEY: [
              self._inference_result
          ],
      }
      self._output_dict_oe = {
          standard_component_specs.OUTPUT_EXAMPLES_KEY: [
              self._output_examples
          ],
      }
  
      # Create exe properties.
      self._exec_properties = {
          standard_component_specs.DATA_SPEC_KEY: proto_utils.proto_to_json(
              bulk_inferrer_pb2.DataSpec()
          ),
          standard_component_specs.MODEL_SPEC_KEY: proto_utils.proto_to_json(
              bulk_inferrer_pb2.ModelSpec()
          ),
          "component_id": self.component_id,
      }
  
      # Create context
      self._tmp_dir = os.path.join(self._output_data_dir, ".temp")
      self._context = executor.Executor.Context(
          tmp_dir=self._tmp_dir, unique_id="2"
      )
  
file_path: tfx/tfx/components/bulk_inferrer/executor_test.py
imports: import os
  import tensorflow
  from tfx.components.bulk_inferrer import executor
  from tfx.dsl.io import fileio
  from tfx.proto import bulk_inferrer_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
  from tfx.utils import io_utils
  from tfx.utils import proto_utils
  from google.protobuf import text_format
  from tensorflow_serving.apis import prediction_log_pb2
label_desc: Use image node_id 1 for calling the ExecutorTest obj's underlying member method code with example usage: obj.setUp() without return types