code: def predict(model, X, joint_contribution=False):
      """Returns a triple (prediction, bias, feature_contributions), such
      that prediction ≈ bias + feature_contributions.
      Parameters
      ----------
      model : DecisionTreeRegressor, DecisionTreeClassifier,
          ExtraTreeRegressor, ExtraTreeClassifier,
          RandomForestRegressor, RandomForestClassifier,
          ExtraTreesRegressor, ExtraTreesClassifier
      Scikit-learn model on which the prediction should be decomposed.
  
      X : array-like, shape = (n_samples, n_features)
      Test samples.
  
      joint_contribution : boolean
      Specifies if contributions are given individually from each feature,
      or jointly over them
  
      Returns
      -------
      decomposed prediction : triple of
      * prediction, shape = (n_samples) for regression and (n_samples, n_classes)
          for classification
      * bias, shape = (n_samples) for regression and (n_samples, n_classes) for
          classification
      * contributions, If joint_contribution is False then returns and  array of
          shape = (n_samples, n_features) for regression or
          shape = (n_samples, n_features, n_classes) for classification, denoting
          contribution from each feature.
          If joint_contribution is True, then shape is array of size n_samples,
          where each array element is a dict from a tuple of feature indices to
          to a value denoting the contribution from that feature tuple.
      """
      # Only single out response variable supported,
      if model.n_outputs_ > 1:
          raise ValueError(
              "Multilabel classification trees not supported"
          )
  
      if isinstance(model, DecisionTreeClassifier) or isinstance(
          model, DecisionTreeRegressor
      ):
          return _predict_tree(
              model, X, joint_contribution=joint_contribution
          )
      elif (
          isinstance(model, RandomForestClassifier)
          or isinstance(model, ExtraTreesClassifier)
          or isinstance(model, RandomForestRegressor)
          or isinstance(model, ExtraTreesRegressor)
      ):
          return _predict_forest(
              model, X, joint_contribution=joint_contribution
          )
      else:
          raise ValueError(
              "Wrong model type. Base learner needs to be a "
              "DecisionTreeClassifier or DecisionTreeRegressor."
          )
  
file_path: treeinterpreter/treeinterpreter/treeinterpreter.py
imports: import numpy
  import sklearn
  from sklearn.ensemble import RandomForestClassifier, ExtraTreesClassifier, RandomForestRegressor, ExtraTreesRegressor
  from sklearn.tree import DecisionTreeRegressor, DecisionTreeClassifier, _tree
  from distutils.version import LooseVersion
label_desc: Use image node_id 5 for calling a global function with example usage: predict(model, X, joint_contribution) and returns: _predict_tree, _predict_forest