code: def _compute_node_values(tree_info):
      """Add node_value key with an expected value for non-leaf nodes"""
  
      def walk(tree):
          if "leaf_value" in tree:
              return tree["leaf_value"], tree.get("leaf_count", 0)
          left_value, left_count = walk(tree["left_child"])
          right_value, right_count = walk(tree["right_child"])
          count = left_count + right_count
          if tree["split_gain"] <= 0:
              assert left_value == right_value
              tree["_node_value"] = left_value
          else:
              tree["_node_value"] = (
                  left_value * left_count + right_value * right_count
              ) / count
          return tree["_node_value"], count
  
      for tree in tree_info:
          walk(tree["tree_structure"])
  
file_path: eli5/eli5/lightgbm.py
imports: from __future__ import absolute_import, division
  from collections import defaultdict
  from typing import DefaultDict, Optional
  import numpy
  import lightgbm
  from eli5.explain import explain_weights, explain_prediction
  from eli5._feature_importances import get_feature_importance_explanation
  from eli5.sklearn.utils import handle_vec, get_X, get_X0, add_intercept, predict_proba
  from eli5._decision_path import get_decision_path_explanation
label_desc: Use image node_id 5 for calling a global function with example usage: _compute_node_values(tree_info) and returns: tree,  count, tree,  tree