Implement a function to calculate the similarity between two high-dimensional vectors.
Use cosine similarity, defined as the dot product divided by the product of the vectors' Euclidean magnitudes. The vectors have equal, nonzero length; return 0.0 if either vector has zero magnitude.
Function: def cosine_similarity(vector_a, vector_b): Return a floating-point value in the range [-1.0, 1.0].
0.0 if either vector has zero magnitudedef cosine_similarity(vector_a, vector_b):