class_docstr: TFX interactive context for interactive TFX notebook development.
  
  Note: these APIs are **experimental** and major changes to interface and
  functionality are expected.
class_docstr_tok: ["TFX","interactive","context","for","interactive","TFX","notebook","development",".","Note",":","these","APIs","are","*","*","experimental","*","*","and","major","changes","to","interface","and","functionality","are","expected","."]
docstr: Run a given TFX component in the interactive context.
  
  Args:
    component: Component instance to be run.
    enable_cache: whether caching logic should be enabled in the driver.
    beam_pipeline_args: Optional Beam pipeline args for beam jobs within
      executor. Executor will use beam DirectRunner as Default. If provided,
      will override beam_pipeline_args specified in constructor.
  
  Returns:
    execution_result.ExecutionResult object.
docstr_tok: ["Run","a","given","TFX","component","in","the","interactive","context",".","Args",":","component",":","Component","instance","to","be","run",".","enable_cache",":","whether","caching","logic","should","be","enabled","in","the","driver",".","beam_pipeline_args",":","Optional","Beam","pipeline","args","for","beam","jobs","within","executor",".","Executor","will","use","beam","DirectRunner","as","Default",".","If","provided",",","will","override","beam_pipeline_args","specified","in","constructor",".","Returns",":","execution_result.ExecutionResult","object","."]
code: def run(
      self,
      component: base_node.BaseNode,
      enable_cache: bool = True,
      beam_pipeline_args: Optional[List[str]] = None,
  ) -> execution_result.ExecutionResult:
      """Run a given TFX component in the interactive context.
  
      Args:
        component: Component instance to be run.
        enable_cache: whether caching logic should be enabled in the driver.
        beam_pipeline_args: Optional Beam pipeline args for beam jobs within
          executor. Executor will use beam DirectRunner as Default. If provided,
          will override beam_pipeline_args specified in constructor.
  
      Returns:
        execution_result.ExecutionResult object.
      """
      run_id = datetime.datetime.now().isoformat()
      pipeline_info = data_types.PipelineInfo(
          pipeline_name=self.pipeline_name,
          pipeline_root=self.pipeline_root,
          run_id=run_id,
      )
      driver_args = data_types.DriverArgs(
          enable_cache=enable_cache, interactive_resolution=True
      )
      metadata_connection = metadata.Metadata(
          self.metadata_connection_config
      )
      beam_pipeline_args = list(
          beam_pipeline_args or self.beam_pipeline_args
      )
      additional_pipeline_args = {}
      for name, output in component.outputs.items():
          for artifact in output.get():
              artifact.pipeline_name = self.pipeline_name
              artifact.producer_component = component.id
              artifact.name = name
      # Special treatment for pip dependencies.
      # TODO(b/187122662): Pass through pip dependencies as a first-class
      # component flag.
      if isinstance(component, base_component.BaseComponent):
          component._resolve_pip_dependencies(
              self.pipeline_root
          )  # pylint: disable=protected-access
      # TODO(hongyes): figure out how to resolve launcher class in the interactive
      # context.
      launcher = in_process_component_launcher.InProcessComponentLauncher.create(
          component,
          pipeline_info,
          driver_args,
          metadata_connection,
          beam_pipeline_args,
          additional_pipeline_args,
      )
      try:
          import colab  # pytype: disable=import-error # pylint: disable=g-import-not-at-top, unused-import, unused-variable
  
          runner_label = "interactivecontext-colab"
      except ImportError:
          runner_label = "interactivecontext"
      with telemetry_utils.scoped_labels(
          {
              telemetry_utils.LABEL_TFX_RUNNER: runner_label,
          }
      ):
          execution_id = launcher.launch().execution_id
  
      return execution_result.ExecutionResult(
          component=component, execution_id=execution_id
      )
  
imports: import datetime
  import html
  import os
  import tempfile
  from typing import List, Optional
  import absl
  import jinja2
  import nbformat
  from tfx import types
  from tfx.dsl.components.base import base_component
  from tfx.dsl.components.base import base_node
  from tfx.orchestration import data_types
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.interactive import execution_result
  from tfx.orchestration.experimental.interactive import notebook_formatters
  from tfx.orchestration.experimental.interactive import notebook_utils
  from tfx.orchestration.experimental.interactive import standard_visualizations
  from tfx.orchestration.experimental.interactive import visualizations
  from tfx.orchestration.launcher import in_process_component_launcher
  from tfx.utils import telemetry_utils
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 2 for calling the InteractiveContext obj's underlying member method code with example usage: obj.run(component, enable_cache, beam_pipeline_args) and returns: execution_result