code: def findCosineDistance(
      source_representation: Union[np.ndarray, list],
      test_representation: Union[np.ndarray, list],
  ) -> np.float64:
      if isinstance(source_representation, list):
          source_representation = np.array(source_representation)
  
      if isinstance(test_representation, list):
          test_representation = np.array(test_representation)
  
      a = np.matmul(
          np.transpose(source_representation), test_representation
      )
      b = np.sum(
          np.multiply(source_representation, source_representation)
      )
      c = np.sum(np.multiply(test_representation, test_representation))
      return 1 - (a / (np.sqrt(b) * np.sqrt(c)))
  
imports: from typing import Union
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: findCosineDistance(source_representation, test_representation) and returns: unknown