code: def test_multidim_scaling(cats_and_labels, rng, update_rng, center):
      # compute pairwise distance
      X, y = cats_and_labels
      n_cols = X.shape[1]
      cat_vars = {i: None for i in range(n_cols)}
      d_pair = abdm(X, cat_vars)
  
      # apply multidimensional scaling
      d_abs, new_rng = multidim_scaling(
          d_pair,
          feature_range=rng,
          update_feature_range=update_rng,
          center=center,
      )
      assert list(d_abs.keys()) == list(cat_vars.keys())
      if update_rng:
          assert (new_rng[0] != rng[0]).any()
          assert (new_rng[1] != rng[1]).any()
      else:
          assert (new_rng[0] == rng[0]).all()
          assert (new_rng[1] == rng[1]).all()
  
      for k, v in d_abs.items():
          assert v.shape[0] == d_pair[k].shape[0]
          if center:
              assert (v.max() + v.min()) - (
                  rng[1][0, k] + rng[0][0, k]
              ) < 1e-5
  
file_path: alibi-detect/alibi_detect/utils/tests/test_distance.py
imports: import numpy
  from scipy.spatial.distance import cityblock
  from itertools import product
  import pytest
  from alibi_detect.utils.distance import pairwise_distance, abdm, cityblock_batch, mvdm, multidim_scaling
label_desc: Use image node_id 7 for calling a global function with example usage: test_multidim_scaling(cats_and_labels, rng, update_rng, center) without return types