code: def ward_quick(G, feature, verbose=False):
      """Agglomerative function based on a topology-defining graph
      and a feature matrix.
  
      Parameters
      ----------
      G : graph instance
          topology-defining graph
      feature: array of shape (G.V,dim_feature)
          some vectorial information related to the graph vertices
      verbose : bool, optional
           If True, print diagnostic information
  
      Returns
      -------
      t: weightForest instance,
         that represents the dendrogram of the data
  
      Notes
      ----
      Hopefully a quicker version
  
      A euclidean distance is used in the feature space
  
      Caveat : only approximate
      """
      warn(
          "Function ward_quick from "
          + "nipy.algorithms.clustering.hierrachical_clustering "
          + "deprecated, will be removed",
          FutureWarning,
          stacklevel=2,
      )
  
      # basic check
      if feature.ndim == 1:
          feature = np.reshape(feature, (-1, 1))
  
      if feature.shape[0] != G.V:
          raise ValueError(
              "Incompatible dimension for the feature matrix and the graph"
          )
  
      Features = [
          np.ones(2 * G.V),
          np.zeros((2 * G.V, feature.shape[1])),
          np.zeros((2 * G.V, feature.shape[1])),
      ]
      Features[1][: G.V] = feature
      Features[2][: G.V] = feature**2
      n = G.V
      nbcc = G.cc().max() + 1
  
      # prepare a graph with twice the number of vertices
      K = _auxiliary_graph(G, Features)
      parent = np.arange(2 * n - nbcc).astype(np.int_)
      height = np.zeros(2 * n - nbcc)
      linc = K.left_incidence()
      rinc = K.right_incidence()
  
      # iteratively merge clusters
      q = 0
      while q < n - nbcc:
          # 1. find the lightest edges
          aux = np.zeros(2 * n)
          ape = np.nonzero(K.weights < np.inf)
          ape = np.reshape(ape, np.size(ape))
          idx = np.argsort(K.weights[ape])
  
          for e in range(n - nbcc - q):
              i, j = K.edges[ape[idx[e]], 0], K.edges[ape[idx[e]], 1]
              if (aux[i] == 1) or (aux[j] == 1):
                  break
              aux[i] = 1
              aux[j] = 1
  
          emax = np.maximum(e, 1)
  
          for e in range(emax):
              m = ape[idx[e]]
              cost = K.weights[m]
              k = q + n
              i = K.edges[m, 0]
              j = K.edges[m, 1]
              height[k] = cost
              if verbose:
                  print(q, i, j, m, cost)
  
              # 2. remove the current edge
              K.edges[m] = -1
              K.weights[m] = np.inf
              linc[i].remove(m)
              rinc[j].remove(m)
  
              ml = linc[j]
              if np.sum(K.edges[ml, 1] == i) > 0:
                  m = ml[int(np.flatnonzero(K.edges[ml, 1] == i))]
                  K.edges[m] = -1
                  K.weights[m] = np.inf
                  linc[j].remove(m)
                  rinc[i].remove(m)
  
              # 3. merge the edges with third part edges
              parent[i] = k
              parent[j] = k
              for p in range(3):
                  Features[p][k] = Features[p][i] + Features[p][j]
  
              linc, rinc = _remap(K, i, j, k, Features, linc, rinc)
              q += 1
  
      # build a tree to encode the results
      t = WeightedForest(2 * n - nbcc, parent, height)
      return t
  
imports: from warnings import warn
  import numpy
  from ..graph.forest import Forest
  from ..graph.graph import WeightedGraph
label_desc: Use image node_id 9 for calling a global function with example usage: ward_quick(G, feature, verbose) and returns: t