code: def cosine_sim(vec1, vec2):
      
      vec1 = [val for val in vec1.values()]
      vec2 = [val for val in vec2.values()]
      
      dot_prod = 0
      for i, v in enumerate(vec1):
          dot_prod += v * vec2[i]
          
      mag_1 = math.sqrt(sum([x**2 for x in vec1]))
      mag_2 = math.sqrt(sum([x**2 for x in vec2]))
      
      return dot_prod / (mag_1 * mag_2)
docs: Since our vectors are dictionaries, lets convert them to lists for easier mathing.