code: def get_tree_params_and_type(
      tree_infos, get_tree_parameters, extra_config
  ):
      """
      Populate the parameters from the trees and pick the tree implementation strategy.
  
      Args:
          tree_infos: The information representaing a tree (ensemble)
          get_tree_parameters: A function specifying how to parse the tree_infos into a
                               `operator_converters._tree_commons_TreeParameters` object
          extra_config: param extra_config: Extra configuration used also to select the best conversion strategy
  
      Returns:
          The tree parameters, the maximum tree-depth and the tre implementation to use
      """
      tree_parameters = [
          get_tree_parameters(tree_info, extra_config)
          for tree_info in tree_infos
      ]
      max_depth = max(1, _find_max_depth(tree_parameters))
      tree_type = get_tree_implementation_by_config_or_depth(
          extra_config, max_depth
      )
  
      return tree_parameters, max_depth, tree_type
  
imports: import copy
  import numpy
  import torch
  from ._tree_implementations import TreeImpl
  from ._tree_implementations import GEMMDecisionTreeImpl, TreeTraversalDecisionTreeImpl, PerfectTreeTraversalDecisionTreeImpl
  from .None import constants
  from hummingbird.ml.exceptions import MissingConverter
label_desc: Use image node_id 4 for calling a global function with example usage: get_tree_params_and_type(tree_infos, get_tree_parameters, extra_config) and returns: tree_parameters,  max_depth,  tree_type