Implement a function that computes the cosine similarity between two high-dimensional numeric vectors. Cosine similarity is defined as the dot product of the vectors divided by the product of their magnitudes.
Write a function cosine_similarity(vec1, vec2) that takes two lists of numbers of equal length and returns a floating-point value.
0.0.def cosine_similarity(vec1, vec2):