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