code: def cosine_distance(embeddings1, embeddings2):
      # Distance based on cosine similarity
      dot = np.sum(np.multiply(embeddings1, embeddings2), axis=1)
      norm = np.linalg.norm(embeddings1, axis=1) * np.linalg.norm(
          embeddings2, axis=1
      )
      similarity = dot / norm
      dist = np.arccos(similarity) / math.pi
      return dist
  
imports: import tensorflow
  import numpy
  from PIL import Image
  import sys
  from scipy import misc
  import os
  import time
  from adversarialbox.attacks.tf.tools import deepfool
  import facenet
label_desc: Use image node_id 6 for calling a global function with example usage: cosine_distance(embeddings1, embeddings2) and returns: dist