code: def tree_norm(w, n_features, idx, n_nodes):
      """
      This function computes \sum z_i||w_{G_{i}}||
      """
      obj = 0
      # test whether the first node is special
      if idx[0, 0] == -1 and idx[1, 0] == -1:
          z = idx[2, 0]
          for j in range(n_features):
              obj += np.abs(w[j])
          obj *= z
          i = 1
      else:
          i = 0
  
      # sequentially process each node
      while i < n_nodes:
          two_norm = 0
          start_idx = int(idx[0, i] - 1)
          end_idx = int(idx[1, i])
          for j in range(start_idx, end_idx):
              two_norm += w[j] * w[j]
          two_norm = np.sqrt(two_norm)
          z = idx[2, i]
          obj += z * two_norm
          i += 1
      return obj
  
file_path: scikit-feature/skfeature/utility/sparse_learning.py
imports: import numpy
  from numpy import linalg
label_desc: Use image node_id 8 for calling a global function with example usage: tree_norm(w, n_features, idx, n_nodes) and returns: obj