code: def setUp(self):
      super().setUp()
  
      # List of packages installed.
      self._pip_list = pip_utils.get_package_names()
  
      # Check if Kubeflow is installed before running E2E tests.
      if labels.KUBEFLOW_PACKAGE_NAME not in self._pip_list:
          sys.exit("Kubeflow not installed.")
  
      # Change the encoding for Click since Python 3 is configured to use ASCII as
      # encoding for the environment.
      if codecs.lookup(locale.getpreferredencoding()).name == "ascii":
          os.environ["LANG"] = "en_US.utf-8"
  
      # Testdata path.
      self._testdata_dir = os.path.join(
          os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
          "testdata",
      )
      self._testdata_dir_updated = self.tmp_dir
      fileio.makedirs(self._testdata_dir_updated)
  
      self.enter_context(
          test_case_utils.change_working_dir(self.tmp_dir)
      )
  
      # Generate a unique pipeline name. Uses tmp_dir as a random seed.
      self._pipeline_name = (
          "cli-kubeflow-e2e-test-"
          + test_utils.generate_random_id(self.tmp_dir)
      )
      absl.logging.info("Pipeline name is %s" % self._pipeline_name)
      self._pipeline_name_v2 = self._pipeline_name + "_v2"
  
      orig_pipeline_path = os.path.join(
          self._testdata_dir, "test_pipeline_kubeflow_1.py"
      )
      self._pipeline_path = os.path.join(
          self._testdata_dir_updated, "test_pipeline_kubeflow_1.py"
      )
      self._pipeline_path_v2 = os.path.join(
          self._testdata_dir_updated, "test_pipeline_kubeflow_2.py"
      )
  
      test_utils.copy_and_change_pipeline_name(
          orig_pipeline_path,
          self._pipeline_path,
          "chicago_taxi_pipeline_kubeflow",
          self._pipeline_name,
      )
      self.assertTrue(fileio.exists(self._pipeline_path))
      test_utils.copy_and_change_pipeline_name(
          orig_pipeline_path,
          self._pipeline_path_v2,
          "chicago_taxi_pipeline_kubeflow",
          self._pipeline_name_v2,
      )
      self.assertTrue(fileio.exists(self._pipeline_path_v2))
  
      # Endpoint URL
      self._endpoint = self._get_endpoint(
          subprocess.check_output(
              "kubectl describe configmap inverse-proxy-config -n kubeflow".split()
          )
      )
      absl.logging.info("ENDPOINT: " + self._endpoint)
  
      try:
          # Create a kfp client for cleanup after running commands.
          self._client = kfp.Client(host=self._endpoint)
      except kfp_server_api.rest.ApiException as err:
          absl.logging.info(err)
  
imports: import codecs
  import locale
  import os
  import subprocess
  import sys
  from typing import Optional
  import absl
  from google.cloud import storage
  import kfp
  import kfp_server_api
  import tensorflow
  from tfx.dsl.io import fileio
  from tfx.tools.cli import labels
  from tfx.tools.cli import pip_utils
  from tfx.tools.cli.e2e import test_utils
  from tfx.utils import retry
  from tfx.utils import test_case_utils
label_desc: Use image node_id 2 for calling the CliKubeflowEndToEndTest obj's underlying member method code with example usage: obj.setUp() without return types