code: def run_cli(args: List[str]) -> str:
      """Run CLI with given arguments. Raises CalledProcessError if failed."""
      logging.info("Running cli: %s", args)
      try:
          result = subprocess.run(
              ["tfx"] + args,
              stdout=subprocess.PIPE,
              stderr=subprocess.STDOUT,
              encoding="utf-8",
              check=True,
          )
      except subprocess.CalledProcessError as err:
          logging.error(
              "Command failed (exit code %d) with output: %s",
              err.returncode,
              err.output,
          )
          raise err
      logging.info("[CLI] %s", result.stdout)
      return result.stdout
  
file_path: tfx/tfx/tools/cli/e2e/test_utils.py
imports: import datetime
  import random
  import string
  import subprocess
  from typing import Any, List
  from absl import logging
  from tfx import components
  from tfx.dsl.components.base.base_component import BaseComponent
  from tfx.utils import io_utils
label_desc: Use image node_id 4 for calling a global function with example usage: run_cli(args) and returns: result