code: def test_compute_full_tree():
      # Test that the full tree is computed if n_clusters is small
      rng = np.random.RandomState(0)
      X = rng.randn(10, 2)
      connectivity = kneighbors_graph(X, 5, include_self=False)
  
      # When n_clusters is less, the full tree should be built
      # that is the number of merges should be n_samples - 1
      agc = AgglomerativeClustering(
          n_clusters=2, connectivity=connectivity
      )
      agc.fit(X)
      n_samples = X.shape[0]
      n_nodes = agc.children_.shape[0]
      assert n_nodes == n_samples - 1
  
      # When n_clusters is large, greater than max of 100 and 0.02 * n_samples.
      # we should stop when there are n_clusters.
      n_clusters = 101
      X = rng.randn(200, 2)
      connectivity = kneighbors_graph(X, 10, include_self=False)
      agc = AgglomerativeClustering(
          n_clusters=n_clusters, connectivity=connectivity
      )
      agc.fit(X)
      n_samples = X.shape[0]
      n_nodes = agc.children_.shape[0]
      assert n_nodes == n_samples - n_clusters
  
imports: import itertools
  import shutil
  from functools import partial
  from tempfile import mkdtemp
  import numpy
  import pytest
  from scipy.cluster import hierarchy
  from scipy.sparse.csgraph import connected_components
  from sklearn.cluster import AgglomerativeClustering, FeatureAgglomeration, ward_tree
  from sklearn.cluster._agglomerative import _TREE_BUILDERS, _fix_connectivity, _hc_cut, linkage_tree
  from sklearn.cluster._hierarchical_fast import average_merge, max_merge, mst_linkage_core
  from sklearn.datasets import make_circles, make_moons
  from sklearn.feature_extraction.image import grid_to_graph
  from sklearn.metrics import DistanceMetric
  from sklearn.metrics.cluster import adjusted_rand_score, normalized_mutual_info_score
  from sklearn.metrics.pairwise import PAIRED_DISTANCES, cosine_distances, manhattan_distances, pairwise_distances
  from sklearn.metrics.tests.test_dist_metrics import METRICS_DEFAULT_PARAMS
  from sklearn.neighbors import kneighbors_graph
  from sklearn.utils._fast_dict import IntFloatDict
  from sklearn.utils._testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal, create_memmap_backed_data, ignore_warnings
  from sklearn.utils.fixes import LIL_CONTAINERS
label_desc: Use image node_id 23 for calling a global function with example usage: test_compute_full_tree() without return types