input: Write a function to visually summarize the Twitter data. The function should process the input data and generate three bar plots: one for the number of tweets per author, one for the number of likes per tweet, and one for the number of retweets per tweet.
  import matplotlib.pyplot as plt
  
  def summarize_twitter_data(twitter_data):
      # Process the Twitter data to extract the relevant data fields
      authors = [tweet['author'] for tweet in twitter_data]
      num_tweets = [authors.count(author) for author in set(authors)]
      tweets = [tweet['text'] for tweet in twitter_data]
      num_likes = [tweet['likes'] for tweet in twitter_data]
      num_retweets = [tweet['retweets'] for tweet in twitter_data]
  
      # Plot the tweet authors
      plt.xlabel('Tweet Authors')
      plt.ylabel('Number of tweets')
      plt.title('Tweet Author Summary')
      plt.bar(set(authors), num_tweets)
      plt.show()
  
      # Plot the number of likes
      plt.xlabel('Tweets')
      plt.ylabel('Number of Likes')
      plt.title('Number of Likes Summary')
      plt.bar(tweets, num_likes)
      plt.show()
  
      # Plot the number of retweets
      plt.xlabel('Tweets')
      plt.ylabel('Number of Retweets')
      plt.title('Number of Retweets Summary')
      plt.bar(tweets, num_retweets)
      plt.show()
  
  # Test cases
  twitter_data1 = [
      {'author': 'user1', 'text': 'Tweet 1', 'likes': 10, 'retweets': 5},
      {'author': 'user2', 'text': 'Tweet 2', 'likes': 5, 'retweets': 2},
      {'author': 'user1', 'text': 'Tweet 3', 'likes': 3, 'retweets': 1}
  ]
  
  twitter_data2 = [
      {'author': 'user3', 'text': 'Tweet 4', 'likes': 15, 'retweets': 10},
      {'author': 'user3', 'text': 'Tweet 5', 'likes': 8, 'retweets': 4},
      {'author': 'user2', 'text': 'Tweet 6', 'likes': 2, 'retweets': 1}
  ]
  
  summarize_twitter_data(twitter_data1)
  summarize_twitter_data(twitter_data2)
output: def summarize_twitter_data(twitter_data):
      authors = [tweet['author'] for tweet in twitter_data]
      num_tweets = [authors.count(author) for author in set(authors)]
      tweets = [tweet['text'] for tweet in twitter_data]
      num_likes = [tweet['likes'] for tweet in twitter_data]
      num_retweets = [tweet['retweets'] for tweet in twitter_data]
  
      plt.figure(figsize=(12, 4))
  
      plt.subplot(1, 3, 1)
      plt.bar(set(authors), num_tweets)
      plt.xlabel('Tweet Authors')
      plt.ylabel('Number of tweets')
      plt.title('Tweet Author Summary')
  
      plt.subplot(1, 3, 2)
      plt.bar(tweets, num_likes)
      plt.xlabel('Tweets')
      plt.ylabel('Number of Likes')
      plt.title('Number of Likes Summary')
  
      plt.subplot(1, 3, 3)
      plt.bar(tweets, num_retweets)
      plt.xlabel('Tweets')
      plt.ylabel('Number of Retweets')
      plt.title('Number of Retweets Summary')
  
      plt.tight_layout()
      plt.show()