code: def get_node_nsamples_by_class(self, id):
      def _get_value(spark_version):
          if spark_version >= 3:
              return np.array(
                  self.tree_nodes[id].impurityStats().stats()
              )
          elif spark_version >= 2:
              return np.array(
                  list(self.tree_nodes[id].impurityStats().stats())
              )
          else:
              raise Exception("dtreeviz supports spark versions >= 2")
  
      if self.is_classifier():
          return _get_value(
              ShadowSparkTree._get_pyspark_major_version()
          )
  
imports: from abc import ABC
  from collections import defaultdict
  from typing import List, Mapping
  import numpy
  import pyspark
  from dtreeviz.models.shadow_decision_tree import ShadowDecTree
  from dtreeviz.utils import criterion_remapping
  from pyspark.ml.classification import DecisionTreeClassificationModel
  from pyspark.ml.regression import DecisionTreeRegressionModel
label_desc: Use image node_id 21 for calling the ShadowSparkTree obj's underlying member method code with example usage: obj.get_node_nsamples_by_class(id) and returns: _get_value, np, np