code: def make_beam_dependency_flags(
      beam_pipeline_args: List[str],
  ) -> List[str]:
      """Make beam arguments for TFX python dependencies, if latter was not set.
  
      When TFX executors are used with non-local beam runners (Dataflow, Flink, etc)
      the remote runner needs to have access to TFX executors.
      This function acts as a helper to provide TFX source package to Beam if user
      does not provide that through Beam pipeline args.
  
      Args:
        beam_pipeline_args: original Beam pipeline args.
  
      Returns:
        updated Beam pipeline args with TFX dependencies added.
      """
      # TODO(b/176857256): Change guidance message once "ml-pipelines-sdk" extra
      # package specifiers are available.
      try:
          import apache_beam as beam  # pylint: disable=g-import-not-at-top
      except ModuleNotFoundError as e:
          raise Exception(
              "Apache Beam must be installed to use this functionality."
          ) from e
      pipeline_options = beam.options.pipeline_options.PipelineOptions(
          flags=beam_pipeline_args
      )
      all_options = pipeline_options.get_all_options()
      for flag_name in [
          "extra_packages",
          "setup_file",
          "requirements_file",
          "worker_harness_container_image",
          "sdk_container_image",
      ]:
          if all_options.get(flag_name):
              absl.logging.info(
                  "Nonempty beam arg %s already includes dependency",
                  flag_name,
              )
              return beam_pipeline_args
      absl.logging.info(
          "Attempting to infer TFX Python dependency for beam"
      )
      dependency_flags = []
      sdist_file = build_ephemeral_package()
      absl.logging.info(
          "Added --extra_package=%s to beam args", sdist_file
      )
      dependency_flags.append("--extra_package=%s" % sdist_file)
      return beam_pipeline_args + dependency_flags
  
file_path: tfx/tfx/utils/dependency_utils.py
imports: import os
  import shutil
  import subprocess
  import sys
  import tempfile
  from typing import List
  import absl
  from tfx import dependencies
  from tfx import version
  from tfx.dsl.io import fileio
  from tfx.utils import io_utils
label_desc: Use image node_id 1 for calling a global function with example usage: make_beam_dependency_flags(beam_pipeline_args) and returns: unknown, beam_pipeline_args