code: def get_decision_path_explanation(
      estimator,
      doc,
      vec,
      vectorized,
      x,
      feature_names,
      feature_filter,
      feature_re,
      top,
      original_display_names,
      target_names,
      targets,
      top_targets,
      is_regression,
      is_multiclass,
      proba,
      get_score_weights,
  ):
      # type: (...) -> Explanation
  
      display_names = get_target_display_names(
          original_display_names,
          target_names,
          targets,
          top_targets,
          proba,
      )
      flt_feature_names, flt_indices = feature_names.handle_filter(
          feature_filter, feature_re, x
      )
  
      def get_top_features(weights, scale=1.0):
          return get_top_features_filtered(
              x, flt_feature_names, flt_indices, weights, top, scale
          )
  
      explanation = Explanation(
          estimator=repr(estimator),
          method="decision paths",
          description={
              (False, False): DESCRIPTION_CLF_BINARY,
              (False, True): DESCRIPTION_CLF_MULTICLASS,
              (True, False): DESCRIPTION_REGRESSION,
          }[is_regression, is_multiclass],
          is_regression=is_regression,
          targets=[],
      )
      assert explanation.targets is not None
  
      if is_multiclass:
          for label_id, label in display_names:
              score, all_feature_weights = get_score_weights(label_id)
              target_expl = TargetExplanation(
                  target=label,
                  feature_weights=get_top_features(all_feature_weights),
                  score=score,
                  proba=proba[label_id] if proba is not None else None,
              )
              add_weighted_spans(doc, vec, vectorized, target_expl)
              explanation.targets.append(target_expl)
      else:
          score, all_feature_weights = get_score_weights(0)
          if is_regression:
              target, scale, label_id = display_names[-1][1], 1.0, 1
          else:
              (
                  target,
                  scale,
                  label_id,
              ) = get_binary_target_scale_label_id(
                  score, display_names, proba
              )
  
          target_expl = TargetExplanation(
              target=target,
              feature_weights=get_top_features(
                  all_feature_weights, scale
              ),
              score=score,
              proba=proba[label_id] if proba is not None else None,
          )
          add_weighted_spans(doc, vec, vectorized, target_expl)
          explanation.targets.append(target_expl)
  
      return explanation
  
imports: from eli5._feature_weights import get_top_features_filtered
  from eli5.base import Explanation, TargetExplanation
  from eli5.sklearn.text import add_weighted_spans
  from eli5.utils import get_target_display_names, get_binary_target_scale_label_id
label_desc: Use image node_id 1 for calling a global function with example usage: get_decision_path_explanation(estimator, doc, vec, vectorized, x, feature_names, feature_filter, feature_re, top, original_display_names, target_names, targets, top_targets, is_regression, is_multiclass, proba, get_score_weights) and returns: explanation, get_top_features_filtered