code: def bourgain_embedding_matrix(distance_matrix):
      """Use Bourgain algorithm to embed the neural architectures based on their edit-distance.
      Args:
          distance_matrix: A matrix of edit-distances.
      Returns:
          A matrix of distances after embedding.
      """
      distance_matrix = np.array(distance_matrix)
      n = len(distance_matrix)
      if n == 1:
          return distance_matrix
      np.random.seed(123)
      distort_elements = []
      r = range(n)
      k = int(math.ceil(math.log(n) / math.log(2) - 1))
      t = int(math.ceil(math.log(n)))
      counter = 0
      for i in range(0, k + 1):
          for t in range(t):
              s = np.random.choice(r, 2**i)
              for j in r:
                  d = min([distance_matrix[j][s] for s in s])
                  counter += len(s)
                  if i == 0 and t == 0:
                      distort_elements.append([d])
                  else:
                      distort_elements[j].append(d)
      return rbf_kernel(distort_elements, distort_elements)
  
imports: import math
  import random
  from copy import deepcopy
  from functools import total_ordering
  from queue import PriorityQueue
  import numpy
  from scipy.linalg import LinAlgError, cho_solve, cholesky, solve_triangular
  from scipy.optimize import linear_sum_assignment
  from sklearn.metrics.pairwise import rbf_kernel
  from nni.utils import OptimizeMode
  from .graph_transformer import transform
  from .utils import Constant
  from .layers import is_layer
label_desc: Use image node_id 9 for calling a global function with example usage: bourgain_embedding_matrix(distance_matrix) and returns: rbf_kernel, distance_matrix