code: def calculate_mean_unique_calls_in_ensemble(
      ensemble, X, feature_costs=None
  ):
      """Calculate the mean number of unique calls in the ensemble."""
      if X is None:
          # Should pass X, this is just for testing
          n_features_in = ensemble.n_features_in_
          X = np.random.randint(2, size=(100, n_features_in))
  
      if feature_costs is None:
          feature_costs = np.ones(n_features_in, dtype=np.float64)
      else:
          assert (
              len(feature_costs) == n_features_in
          ), f"{len(feature_costs)} != {n_features_in}"
          np.min(feature_costs) >= 0
  
      # extract the decision path for each sample
      ests = ensemble.estimators_.flatten()
      feats = [set() for _ in range(len(X))]
      for i in range(len(ests)):
          est = ests[i]
          node_index = est.decision_path(X).toarray()
          feats_est = [
              set([est.tree_.feature[x] for x in np.nonzero(row)[0]])
              for row in node_index
          ]
          for j in range(len(feats)):
              feats[j] = feats[j].union(feats_est[j])
      # -1 for the -2 feature that is always present
      return np.mean([len(f) - 1 for f in feats])
  
file_path: imodels/imodels/util/tree.py
imports: from sklearn import datasets
  from sklearn.tree import DecisionTreeRegressor
  import numpy
  from sklearn.tree._tree import Tree
  from imodels.tree.custom_greedy_tree import CustomDecisionTreeClassifier
label_desc: Use image node_id 7 for calling a global function with example usage: calculate_mean_unique_calls_in_ensemble(ensemble, X, feature_costs) and returns: np