code: def explain_pipeline(
      pipeline: "Pipeline",
      data: "InputData",
      method: str = "surrogate_dt",
      visualization: bool = False,
      **kwargs,
  ) -> SurrogateExplainer:
      """Create explanation for the `pipeline` according to the selected `method`.
      An `Explainer` instance is returned.
  
      :param pipeline: pipeline to explain.
      :param data: samples to be explained.
      :param method: explanation method, defaults to 'surrogate_dt'. Options: ['surrogate_dt', ...]
      :param visualization: print and plot the explanation simultaneously, defaults to True.
          The explanation can be retrieved later by executing `explainer.visualize()`.
      """
      if not pipeline:
          raise AssertionError(
              "The pipeline might be fit before explanation!"
          )
  
      explainer = pick_pipeline_explainer(
          pipeline, method, data.task.task_type
      )
      explainer.explain(data, visualization=visualization, **kwargs)
  
      return explainer
  
imports: from fedot.core.data.data import InputData
  from fedot.core.pipelines.pipeline import Pipeline
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.explainability.surrogate_explainer import SurrogateExplainer
label_desc: Use image node_id 2 for calling a global function with example usage: explain_pipeline(pipeline, data, method, visualization) and returns: explainer