class_docstr: Abstract base class for Patchers for various "DagRunner"s.
  
  These patcher classes "decorate" the `run` function of the DagRunners.
  The patcher can intercept arguments before/after the run() execution,
  and even skip the real run() execution.
  Users of the patcher can read information about the run using `context`
  which is passed as a context manager of patch(). For example,
  the name of the pipeline can be retrieved with
  `context[DagRunnerPatcher.PIPELINE_NAME]`.
  
  Child class should override get_runner_class() to specify which DagRunner
  class they patch. And they can add more actions in before_run()/after_run()
  as they needed.
class_docstr_tok: ["Abstract","base","class","for","Patchers","for","various","``","DagRunner","''","s.","These","patcher","classes","``","decorate","''","the","`","run","`","function","of","the","DagRunners",".","The","patcher","can","intercept","arguments","before\/after","the","run","(",")","execution",",","and","even","skip","the","real","run","(",")","execution",".","Users","of","the","patcher","can","read","information","about","the","run","using","`","context","`","which","is","passed","as","a","context","manager","of","patch","(",")",".","For","example",",","the","name","of","the","pipeline","can","be","retrieved","with","`","context","[","DagRunnerPatcher.PIPELINE_NAME","]","`",".","Child","class","should","override","get_runner_class","(",")","to","specify","which","DagRunner","class","they","patch",".","And","they","can","add","more","actions","in","before_run","(",")","\/after_run","(",")","as","they","needed","."]
code: def _before_run(
      self,
      runner: tfx_runner.TfxRunner,
      pipeline: Union[pipeline_pb2.Pipeline, tfx_pipeline.Pipeline],
      context: MutableMapping[str, Any],
  ) -> None:
      pass
  
file_path: tfx/tfx/tools/cli/handler/dag_runner_patcher.py
imports: import abc
  import contextlib
  import functools
  from typing import Any, MutableMapping, Type, Union
  from tfx.orchestration import pipeline
  from tfx.orchestration import tfx_runner
  from tfx.orchestration.portable import tfx_runner
  from tfx.proto.orchestration import pipeline_pb2
label_desc: Use image node_id 2 for calling the DagRunnerPatcher obj's underlying member method code with example usage: obj._before_run(runner, pipeline, context) without return types