code: def cdist(X, Y, p=2.0):
      # 2d P, C = X.shape| R, C = Y.shape -> P,R
      P, C = X.shape
      R, C = Y.shape
      # 3d B, P, C = X.shape|1, R, C = Y.shape -> B, P,R
      # D = paddle.linalg.norm(X[:, None, :]-Y[None, :, :], axis=-1)
      """D = paddle.zeros((P, R))
      for i in range(P):
          D[i,:] = paddle.linalg.norm(X[i, None, :]-Y, axis=-1)
          #D[i,:] = (X[i, None, :]-Y).square().sum(-1).sqrt_()
      #"""
      D = []
      for i in range(P):
          D.append(paddle.linalg.norm(X[i, None, :] - Y, axis=-1))
      D = paddle.stack(D, 0)
      return D
  
imports: import os
  import argparse
  import numpy
  import matplotlib
  import matplotlib.pyplot
  from sklearn.metrics import roc_curve, auc
  from tqdm import tqdm
  from skimage import measure, morphology
  from skimage.segmentation import mark_boundaries
  import paddle
label_desc: Use image node_id 8 for calling a global function with example usage: cdist(X, Y, p) and returns: D