class_docstr: Unit test for the distances computed in this script.
class_docstr_tok: ["Unit","test","for","the","distances","computed","in","this","script","."]
code: def test_local_cosine(self):
      ans = 1 - (
          0.7
          / (
              (0.5**2 + 0.7**2) ** 0.5
              * (1**2 + 0.1**2 + 0.5**2) ** 0.5
          )
      )
  
      self.assertAlmostEqual(cosine(self.a, self.b), ans)
      self.assertAlmostEqual(cosine(self.a, {}), 1)
      self.assertAlmostEqual(cosine(self.a, self.a), 0)
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import copy
  import unittest
  import numpy
  import turicreate
  from turicreate.toolkits._main import ToolkitError
  from collections import Counter
  import sys
label_desc: Use image node_id 4 for calling the LocalDistancesTest obj's underlying member method code with example usage: obj.test_local_cosine() without return types