Write a function to calculate the cosine similarity between two high-dimensional vectors from scratch.
Use equal-length Python lists containing numeric values and return a floating-point similarity score between -1 and 1. If either vector has zero magnitude, return 0.0; do not use NumPy or another vector library.
0.0 when either vector has zero magnitudedef cosine_similarity(vector_a, vector_b):