code: def normalized_distance(_target_array, _vec, nan_value=1.0):
      """Compute normalized distance to many points.
  
      Computes || vec - b || / ( ||vec|| + ||b||) for every b in target_array
  
      Args:
          _target_array (numpy.ndarray): N x m array
          _vec (numpy.ndarray): array of size m
          nan_value (Optional[float]): value to replace 0.0/0.0 = nan with
              (default 1.0, to take those featureless images out of contention)
  
      Returns:
          the normalized distance (float)
      """
      target_array = _target_array.astype(int)
      vec = _vec.astype(int)
      topvec = np.linalg.norm(vec - target_array, axis=1)
      norm1 = np.linalg.norm(vec, axis=0)
      norm2 = np.linalg.norm(target_array, axis=1)
      finvec = topvec / (norm1 + norm2)
      finvec[np.isnan(finvec)] = nan_value
  
      return finvec
  
file_path: image-match/image_match/signature_database_base.py
imports: from image_match.goldberg import ImageSignature
  from itertools import product
  from operator import itemgetter
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: normalized_distance(_target_array, _vec, nan_value) and returns: finvec