class_docstr: A Causal Tree regressor class.
  The Causal Tree is a decision tree regressor with a split criteria for treatment effects.
  Details are available at Athey and Imbens (2015) (https://arxiv.org/abs/1504.01132)
class_docstr_tok: ["A","Causal","Tree","regressor","class",".","The","Causal","Tree","is","a","decision","tree","regressor","with","a","split","criteria","for","treatment","effects",".","Details","are","available","at","Athey","and","Imbens","(","2015",")","(","https",":","\/\/arxiv.org\/abs\/1504.01132",")"]
docstr: Count treatment, control distribution for tree nodes/leaves
  Args:
      X: (np.ndarray), feature matrix
      treatment: (np.ndarray), treatment vector
  Returns:
      dict: treatment groups for each tree node/leaves
docstr_tok: ["Count","treatment",",","control","distribution","for","tree","nodes\/leaves","Args",":","X",":","(","np.ndarray",")",",","feature","matrix","treatment",":","(","np.ndarray",")",",","treatment","vector","Returns",":","dict",":","treatment","groups","for","each","tree","node\/leaves"]
code: def _count_groups_distribution(
      self, X: np.ndarray, treatment: np.ndarray
  ) -> dict:
      """
      Count treatment, control distribution for tree nodes/leaves
      Args:
          X: (np.ndarray), feature matrix
          treatment: (np.ndarray), treatment vector
      Returns:
          dict: treatment groups for each tree node/leaves
      """
      check_is_fitted(self)
  
      self.is_leaves = get_tree_leaves_mask(self)
      groups_cnt = {
          idx: {group: 0 for group in self.treatment_groups}
          for idx in np.array(range(self.tree_.node_count))
      }
      node_indicators = self.tree_.decision_path(X.astype(np.float32))
  
      for sample_id in range(X.shape[0]):
          nodes_path = node_indicators.indices[
              node_indicators.indptr[
                  sample_id
              ] : node_indicators.indptr[sample_id + 1]
          ]
  
          if self.groups_cnt_mode == "leaves":
              groups_cnt[nodes_path[-1]][treatment[sample_id]] += 1
          elif self.groups_cnt_mode == "nodes":
              for node_id in nodes_path:
                  groups_cnt[node_id][treatment[sample_id]] += 1
      return groups_cnt
  
imports: import logging
  import sys
  from typing import Union
  import tqdm
  import numpy
  from numpy import float32
  from pathos.pools import ProcessPool
  from scipy.stats import norm
  from sklearn.base import RegressorMixin
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from causalml.inference.meta.utils import check_treatment_vector
  from ._tree import BaseCausalDecisionTree
  from ..utils import get_tree_leaves_mask, timeit
label_desc: Use image node_id 9 for calling the CausalTreeRegressor obj's underlying member method code with example usage: obj._count_groups_distribution(X, treatment) and returns: groups_cnt