code: def get_dist(metric, pt1, pt2):
      if metric == "l2":
          return np.sum((pt1 - pt2) ** 2)
      elif metric == "ip":
          return 1.0 - np.sum(np.multiply(pt1, pt2))
      elif metric == "cosine":
          return (
              1.0
              - np.sum(np.multiply(pt1, pt2))
              / (np.sum(pt1**2) * np.sum(pt2**2)) ** 0.5
          )
  
file_path: hnswlib/tests/python/bindings_test_pickle.py
imports: import pickle
  import unittest
  import numpy
  import hnswlib
label_desc: Use image node_id 1 for calling a global function with example usage: get_dist(metric, pt1, pt2) and returns: np, unknown, unknown