code: def unwound_path_sum(
      feature_indexes,
      zero_fractions,
      one_fractions,
      pweights,
      unique_depth,
      path_index,
  ):
      one_fraction = one_fractions[path_index]
      zero_fraction = zero_fractions[path_index]
      next_one_portion = pweights[unique_depth]
      total = 0
  
      for i in range(unique_depth - 1, -1, -1):
          if one_fraction != 0.0:
              tmp = (
                  next_one_portion
                  * (unique_depth + 1.0)
                  / ((i + 1.0) * one_fraction)
              )
              total += tmp
              next_one_portion = pweights[i] - tmp * zero_fraction * (
                  (unique_depth - i) / (unique_depth + 1.0)
              )
          else:
              total += (pweights[i] / zero_fraction) / (
                  (unique_depth - i) / (unique_depth + 1.0)
              )
  
      return total
  
file_path: shap/shap/explainers/pytree.py
imports: import numpy
  import pandas
  from ..utils._exceptions import ExplainerError
label_desc: Use image node_id 3 for calling a global function with example usage: unwound_path_sum(feature_indexes, zero_fractions, one_fractions, pweights, unique_depth, path_index) and returns: total