code: def pairwise_distance_np(feature, squared=False):
      """Computes the pairwise distance matrix in numpy.
  
      Args:
        feature: 2-D numpy array of size [number of data, feature dimension]
        squared: Boolean. If true, output is the pairwise squared euclidean
          distance matrix; else, output is the pairwise euclidean distance
          matrix.
  
      Returns:
        pairwise_distances: 2-D numpy array of size
          [number of data, number of data].
      """
      triu = np.triu_indices(feature.shape[0], 1)
      upper_tri_pdists = np.linalg.norm(
          feature[triu[1]] - feature[triu[0]], axis=1
      )
      if squared:
          upper_tri_pdists **= 2.0
      num_data = feature.shape[0]
      pairwise_distances = np.zeros((num_data, num_data))
      pairwise_distances[
          np.triu_indices(num_data, 1)
      ] = upper_tri_pdists
      # Make symmetrical.
      pairwise_distances = (
          pairwise_distances
          + pairwise_distances.T
          - np.diag(pairwise_distances.diagonal())
      )
      return pairwise_distances
  
file_path: addons/tensorflow_addons/losses/tests/lifted_test.py
imports: import pytest
  import numpy
  import tensorflow
  from tensorflow_addons.losses import lifted
  from tensorflow_addons.utils import test_utils
label_desc: Use image node_id 1 for calling a global function with example usage: pairwise_distance_np(feature, squared) and returns: pairwise_distances