code: def num_nodes_and_leaves(tree):
      n_nodes = 0
      n_leaves = 0
      for i in range(len(tree.children)):
          if tree.children[i][0] < 0:
              n_leaves += 1
              n_nodes += 1
          else:
              n_nodes += 1
  
      return n_nodes, n_leaves
  
imports: from warnings import warn
  import locale
  import numpy
  import numba
  import scipy.sparse
  from pynndescent.sparse import sparse_mul, sparse_diff, sparse_sum, arr_intersect, sparse_dot_product
  from pynndescent.utils import tau_rand_int, norm
  import joblib
  from collections import namedtuple
label_desc: Use image node_id 21 for calling a global function with example usage: num_nodes_and_leaves(tree) and returns: n_nodes,  n_leaves