code: def test_mst_linkage_core_memory_mapped(metric_param_grid):
      """The MST-LINKAGE-CORE algorithm must work on mem-mapped dataset.
  
      Non-regression test for issue #19875.
      """
      rng = np.random.RandomState(seed=1)
      X = rng.normal(size=(20, 4))
      Xmm = create_memmap_backed_data(X)
      metric, param_grid = metric_param_grid
      keys = param_grid.keys()
      for vals in itertools.product(*param_grid.values()):
          kwargs = dict(zip(keys, vals))
          distance_metric = DistanceMetric.get_metric(metric, **kwargs)
          mst = mst_linkage_core(X, distance_metric)
          mst_mm = mst_linkage_core(Xmm, distance_metric)
          np.testing.assert_equal(mst, mst_mm)
  
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 14 for calling a global function with example usage: test_mst_linkage_core_memory_mapped(metric_param_grid) without return types