code: def setUp(self):
      super().setUp()
  
      # Setup Mocks
  
      patcher = mock.patch.object(request_builder, "build_requests")
      self.build_requests_mock = patcher.start()
      self.addCleanup(patcher.stop)
  
      # Setup directories
  
      source_data_dir = os.path.join(
          os.path.dirname(os.path.dirname(__file__)), "testdata"
      )
      base_output_dir = os.environ.get(
          "TEST_UNDECLARED_OUTPUTS_DIR", self.get_temp_dir()
      )
      output_data_dir = os.path.join(
          base_output_dir, self._testMethodName
      )
  
      # Setup input_dict.
  
      self._model = standard_artifacts.Model()
      self._model.uri = os.path.join(
          source_data_dir, "trainer", "current"
      )
      self._model_path = path_utils.serving_model_path(self._model.uri)
      examples = standard_artifacts.Examples()
      examples.uri = os.path.join(
          source_data_dir, "transform", "transformed_examples", "eval"
      )
      examples.split_names = artifact_utils.encode_split_names(["eval"])
  
      self._input_dict = {
          standard_component_specs.MODEL_KEY: [self._model],
          standard_component_specs.EXAMPLES_KEY: [examples],
      }
      self._blessing = standard_artifacts.InfraBlessing()
      self._blessing.uri = os.path.join(output_data_dir, "blessing")
      self._output_dict = {
          standard_component_specs.BLESSING_KEY: [self._blessing]
      }
      temp_dir = os.path.join(output_data_dir, ".temp")
      self._context = executor.Executor.Context(
          tmp_dir=temp_dir, unique_id="1"
      )
      self._serving_spec = _make_serving_spec(
          {
              "tensorflow_serving": {"tags": ["1.15.0"]},
              "local_docker": {},
              "model_name": "chicago-taxi",
          }
      )
      self._serving_binary = serving_bins.parse_serving_binaries(
          self._serving_spec
      )[0]
      self._validation_spec = _make_validation_spec(
          {"max_loading_time_seconds": 10, "num_tries": 3}
      )
      self._request_spec = _make_request_spec(
          {
              "tensorflow_serving": {
                  "signature_names": ["serving_default"],
              },
              "num_examples": 1,
          }
      )
      self._exec_properties = {
          standard_component_specs.SERVING_SPEC_KEY: proto_utils.proto_to_json(
              self._serving_spec
          ),
          standard_component_specs.VALIDATION_SPEC_KEY: proto_utils.proto_to_json(
              self._validation_spec
          ),
          standard_component_specs.REQUEST_SPEC_KEY: proto_utils.proto_to_json(
              self._request_spec
          ),
      }
  
imports: import os
  import signal
  import threading
  from typing import Any, Dict
  from unittest import mock
  import tensorflow
  from tfx.components.infra_validator import error_types
  from tfx.components.infra_validator import executor
  from tfx.components.infra_validator import request_builder
  from tfx.components.infra_validator import serving_bins
  from tfx.dsl.io import fileio
  from tfx.proto import infra_validator_pb2
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.types import standard_component_specs
  from tfx.utils import path_utils
  from tfx.utils import proto_utils
  from google.protobuf import json_format
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