code: def __init__(self, **kwargs):
      self.atts = TreeEnsembleAttributes()
  
      for name, value in kwargs.items():
          self.atts.add(name, value)
  
      self.tree_ids = sorted(set(self.atts.nodes_treeids))  # type: ignore
      self.root_index = {
          tid: len(self.atts.nodes_treeids) for tid in self.tree_ids  # type: ignore
      }
      for index, tree_id in enumerate(self.atts.nodes_treeids):  # type: ignore
          self.root_index[tree_id] = min(
              self.root_index[tree_id], index
          )
      self.node_index = {
          (tid, nid): i
          for i, (tid, nid) in enumerate(
              zip(self.atts.nodes_treeids, self.atts.nodes_nodeids)  # type: ignore
          )
      }
  
file_path: onnx/onnx/reference/ops/aionnxml/op_tree_ensemble_helper.py
imports: import numpy
label_desc: Use image node_id 1 to create a new TreeEnsemble object  with example: obj = TreeEnsemble()