code: def get_pair_wise_distance(
      ys: List,
      num_classes: int,
      dist_type: str = "kl",
  ) -> np.ndarray:
      num_batches = len(ys)
  
      counts = np.zeros((num_batches, num_classes), dtype=np.int32)
      for i in range(num_batches):
          unique, count = np.unique(ys[i], return_counts=True)
          counts[i, unique] = count
  
      counts += 1
      counts = counts / counts.sum(1).reshape(-1, 1)
      pairwise_dist = np.zeros(
          (num_batches, num_batches), dtype=np.float64
      )
  
      for i in range(0, num_batches - 1):
          for j in range(i + 1, num_batches):
              if dist_type == "l1":
                  pairwise_dist[i, j] = np.sum(
                      np.abs(counts[i] - counts[j])
                  )
              elif dist_type == "kl":
  
                  def kl_divergence(p: np.ndarray, q: np.ndarray):
                      return (p * np.log(p / q)).sum()
  
                  pairwise_dist[i, j] = kl_divergence(
                      counts[i], counts[j]
                  ) + kl_divergence(counts[j], counts[i])
              else:
                  raise ValueError
  
      pairwise_dist += pairwise_dist.T
      pairwise_dist += 1e-5  # for numerical stability
      np.fill_diagonal(pairwise_dist, 0.0)
  
      return pairwise_dist
  
imports: import logging
  import math
  from typing import Callable, Iterator, List, NamedTuple, Optional, Tuple, Union
  import numpy
  import scipy.sparse
  import torch
  from torch import Tensor
  from tqdm import tqdm
  from torch_geometric.data import Data
  from torch_geometric.typing import SparseTensor
  from torch_geometric.utils import get_ppr, is_undirected, subgraph
label_desc: Use image node_id 2 for calling a global function with example usage: get_pair_wise_distance(ys, num_classes, dist_type) and returns: pairwise_dist, unknown