input: Write a function to automatically summarize text using the TextRank algorithm.
  assert summarize_text("Python is an interpreted, high-level, general-purpose programming language. Created by Guido van Rossum and first released in 1991, Python is today used by millions of people all over the world. Python was designed to be highly readable and accessible. Its syntax makes it easy to learn and use.") != ""
  assert summarize_text("Python is amazing.") == "Python is amazing."
  assert summarize_text("This is a test sentence. Another test sentence. Yet another test sentence.") != ""
output: def summarize_text(text):
      from sklearn.feature_extraction.text import CountVectorizer
      from sklearn.metrics.pairwise import cosine_similarity
      import numpy as np
      import networkx as nx
      import nltk
      nltk.download('punkt')
      from nltk.tokenize import sent_tokenize
  
      sentences = sent_tokenize(text)
      if len(sentences) <= 2:
          return text
  
      vectorizer = CountVectorizer().fit_transform(sentences)
      vectors = vectorizer.toarray()
      cosine_matrix = cosine_similarity(vectors)
  
      nx_graph = nx.from_numpy_array(cosine_matrix)
      scores = nx.pagerank(nx_graph)
  
      ranked_sentences = sorted(((scores[i], s) for i, s in enumerate(sentences)), reverse=True)
      summary_sentences = [sentence for _, sentence in ranked_sentences[:len(ranked_sentences) // 3]]
  
      return ' '.join(summary_sentences)