code: def ward_test_more(n=100, k=5, verbose=0):
      # Check that two implementations give the same result
      np.random.seed(0)
      X = randn(n, 2)
      X[: int(math.ceil(n / 3))] += 5
      G = knn(X, 5)
      u, c = ward_segment(G, X, stop=-1, qmax=1, verbose=verbose)
      u1, c = ward_segment(G, X, stop=-1, qmax=k, verbose=verbose)
      u, c = ward_quick_segment(G, X, stop=-1, qmax=1, verbose=verbose)
      u2, c = ward_quick_segment(G, X, stop=-1, qmax=k, verbose=verbose)
      assert np.sum(u1 == u2) == n
  
file_path: nipy/nipy/algorithms/clustering/tests/test_hierarchical_clustering.py
imports: import math
  import numpy
  from numpy.random import randn
  from nipy.algorithms.graph.field import field_from_graph_and_data
  from nipy.algorithms.graph.graph import knn
  from ..hierarchical_clustering import average_link_graph, average_link_graph_segment, ward, ward_field_segment, ward_quick, ward_quick_segment, ward_segment
label_desc: Use image node_id 11 for calling a global function with example usage: ward_test_more(n, k, verbose) without return types