code: def euclidean_distance_matrix(
      mat_a: ndarray, mat_b: ndarray
  ) -> ndarray:
      """Calculate the Euclidean distance matrix.
  
      Args:
          mat_a (ndarray): The point sequence.
          mat_b (ndarray): The point sequence with the same dimensions as mat_a.
  
      returns:
          ndarray: The Euclidean distance matrix.
      """
      assert mat_a.ndim == 2
      assert mat_b.ndim == 2
      assert mat_a.shape[1] == mat_b.shape[1]
  
      m = mat_a.shape[0]
      n = mat_b.shape[0]
  
      mat_a_dots = (mat_a * mat_a).sum(axis=1).reshape(
          (m, 1)
      ) * np.ones(shape=(1, n))
      mat_b_dots = (mat_b * mat_b).sum(axis=1) * np.ones(shape=(m, 1))
      mat_d_squared = mat_a_dots + mat_b_dots - 2 * mat_a.dot(mat_b.T)
  
      zero_mask = np.less(mat_d_squared, 0.0)
      mat_d_squared[zero_mask] = 0.0
      mat_d = np.sqrt(mat_d_squared)
      return mat_d
  
imports: from typing import Dict, List, Optional, Sequence, Tuple, Union
  import cv2
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from mmcv.ops import RoIAlignRotated
  from mmengine.model import BaseModule
  from numpy import ndarray
  from torch import Tensor
  from torch.nn import init
  from mmocr.models.textdet.heads import BaseTextDetHead
  from mmocr.registry import MODELS
  from mmocr.structures import TextDetDataSample
  from mmocr.utils import fill_hole
label_desc: Use image node_id 2 for calling a global function with example usage: euclidean_distance_matrix(mat_a, mat_b) and returns: mat_d