input: 
  def summarize_twitter_data(twitter_data):
      """
      Visualize a summary of the given Twitter data using matplotlib.
      The input is a list of dictionaries where each dictionary represents a tweet with keys:
      'author', 'date', 'text', 'likes', 'retweets'.
      
      >>> summarize_twitter_data([
      ...     {'author': 'User1', 'date': '2023-01-01', 'text': 'Hello', 'likes': 10, 'retweets': 5},
      ...     {'author': 'User2', 'date': '2023-01-02', 'text': 'Hi', 'likes': 5, 'retweets': 2},
      ...     {'author': 'User1', 'date': '2023-01-03', 'text': 'Goodbye', 'likes': 8, 'retweets': 4}
      ... ])
      """
      import matplotlib.pyplot as plt
      from collections import Counter
  
      authors = [tweet['author'] for tweet in twitter_data]
      likes = [tweet['likes'] for tweet in twitter_data]
      retweets = [tweet['retweets'] for tweet in twitter_data]
  
      author_counts = Counter(authors)
      unique_authors = list(author_counts.keys())
      num_tweets = list(author_counts.values())
  
      # Plot the tweet authors
      plt.figure(1)
      plt.xlabel('Tweet Authors')
      plt.ylabel('Number of tweets')
      plt.title('Tweet Author Summary')
      plt.bar(unique_authors, num_tweets)
      plt.show()
  
      # Plot the number of likes
      plt.figure(2)
      plt.xlabel('Tweets')
      plt.ylabel('Number of Likes')
      plt.title('Number of Likes Summary')
      plt.bar(range(len(likes)), likes)
      plt.show()
  
      # Plot the number of retweets
      plt.figure(3)
      plt.xlabel('Tweets')
      plt.ylabel('Number of Retweets')
      plt.title('Number of Retweets Summary')
      plt.bar(range(len(retweets)), retweets)
      plt.show()
  
output:     # Plot the average likes per author
      plt.figure(4)
      avg_likes_per_author = [sum(likes[i] for i in range(len(authors)) if authors[i] == author) / author_counts[author] for author in unique_authors]
      plt.xlabel('Tweet Authors')
      plt.ylabel('Average Likes')
      plt.title('Average Likes per Author')
      plt.bar(unique_authors, avg_likes_per_author)
      plt.show()
  
      # Plot the average retweets per author
      plt.figure(5)
      avg_retweets_per_author = [sum(retweets[i] for i in range(len(authors)) if authors[i] == author) / author_counts[author] for author in unique_authors]
      plt.xlabel('Tweet Authors')
      plt.ylabel('Average Retweets')
      plt.title('Average Retweets per Author')
      plt.bar(unique_authors, avg_retweets_per_author)
      plt.show()