input: Write a function to get cosine similarity scores for a given query and sort the results in descending order.
  assert get_sorted_results("Python is powerful", corpus)==[[0.7071067811865475, 'Python is a great programming language'], [0.408248290463863, 'Data science is also powered by Python'], [0.2886751345948129, 'Python and web development go hand in hand']]
  assert get_sorted_results("web development", corpus)==[[0.5773502691896258, 'Python and web development go hand in hand'], [0.0, 'Python is a great programming language'], [0.0, 'Data science is also powered by Python']]
  assert get_sorted_results("Data science with Python", corpus)==[[0.5, 'Data science is also powered by Python'], [0.0, 'Python is a great programming language'], [0.0, 'Python and web development go hand in hand']]
output: def get_sorted_results(query, corpus):
      from sklearn.feature_extraction.text import TfidfVectorizer
      from sklearn.metrics.pairwise import cosine_similarity
      import numpy as np
  
      # Vectorize the corpus and the query
      vectorizer = TfidfVectorizer().fit(corpus + [query])
      corpus_vectors = vectorizer.transform(corpus)
      query_vector = vectorizer.transform([query])
  
      # Compute cosine similarity
      cosine_similarities = cosine_similarity(query_vector, corpus_vectors).flatten()
  
      # Pair each document with its similarity score
      results = list(zip(cosine_similarities, corpus))
  
      # Sort results by similarity score in descending order
      sorted_results = sorted(results, key=lambda x: x[0], reverse=True)
  
      return sorted_results