code: def test_permed_lsdds(permed_lsdds_params):
      n, m, d, B, n_kcs = permed_lsdds_params
  
      kcs = tf.random.normal((n_kcs, d))
      x_ref = tf.random.normal((n, d))
      x_cur = 10 + 0.2 * tf.random.normal((m, d))
  
      x_full = tf.concat([x_ref, x_cur], axis=0)
      sigma = tf.constant((1.0,))
      k_all_c = GaussianRBF(sigma)(x_full, kcs)
      H = GaussianRBF(np.sqrt(2.0) * sigma)(kcs, kcs)
  
      perms = [tf.random.shuffle(tf.range(n + m)) for _ in range(B)]
      x_perms = [perm[:n] for perm in perms]
      y_perms = [perm[n:] for perm in perms]
  
      lsdd_perms, H_lam_inv, lsdd_unpermed = permed_lsdds(
          k_all_c, x_perms, y_perms, H, return_unpermed=True
      )
  
      assert (
          int(tf.reduce_sum(tf.cast(lsdd_perms > lsdd_unpermed, float)))
          == 0
      )
      assert H_lam_inv.shape == (n_kcs, n_kcs)
  
file_path: alibi-detect/alibi_detect/utils/tensorflow/tests/test_distance_tf.py
imports: import numpy
  from itertools import product
  import pytest
  import tensorflow
  from alibi_detect.utils.tensorflow import GaussianRBF, mmd2, mmd2_from_kernel_matrix, permed_lsdds
  from alibi_detect.utils.tensorflow import relative_euclidean_distance, squared_pairwise_distance
  from alibi_detect.utils.tensorflow import batch_compute_kernel_matrix
label_desc: Use image node_id 11 for calling a global function with example usage: test_permed_lsdds(permed_lsdds_params) without return types