input: Write a function to visualize Twitter data by creating bar charts for the number of tweets per author, the number of likes per tweet, and the number of retweets per tweet. The Twitter data is a stream of tweets with fields like tweet author, date of tweet, text, number of likes, and number of retweets.
  def visualize_twitter_data(twitter_data):
      import matplotlib.pyplot as plt
  
      # Extract the relevant data fields
      authors = []
      num_tweets = []
      tweets = []
      num_likes = []
      num_retweets = []
  
      for tweet in twitter_data:
          authors.append(tweet['author'])
          num_tweets.append(tweet['author'])
          tweets.append(tweet['text'])
          num_likes.append(tweet['likes'])
          num_retweets.append(tweet['retweets'])
  
      # Plot the tweet authors
      plt.figure(1)
      plt.xlabel('Tweet Authors')
      plt.ylabel('Number of tweets')
      plt.title('Tweet Author Summary')
      plt.bar(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(tweets, num_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(tweets, num_retweets)
      plt.show()
  
  assert visualize_twitter_data([{'author': 'User1', 'date': '2023-01-01', 'text': 'Hello', 'likes': 10, 'retweets': 5}, {'author': 'User2', 'date': '2023-01-01', 'text': 'Hi', 'likes': 20, 'retweets': 10}])
  assert visualize_twitter_data([{'author': 'User1', 'date': '2023-01-01', 'text': 'Hello', 'likes': 15, 'retweets': 7}, {'author': 'User1', 'date': '2023-01-02', 'text': 'Hi again', 'likes': 25, 'retweets': 12}])
  assert visualize_twitter_data([])
output: def visualize_twitter_data(twitter_data):
      import matplotlib.pyplot as plt
  
      # Extract the relevant data fields
      authors = []
      num_tweets = []
      tweets = []
      num_likes = []
      num_retweets = []
  
      for tweet in twitter_data:
          if tweet['author'] not in authors:
              authors.append(tweet['author'])
              num_tweets.append(1)
          else:
              num_tweets[authors.index(tweet['author'])] += 1
          tweets.append(tweet['text'])
          num_likes.append(tweet['likes'])
          num_retweets.append(tweet['retweets'])
  
      # Plot the tweet authors
      plt.figure(1)
      plt.xlabel('Tweet Authors')
      plt.ylabel('Number of tweets')
      plt.title('Tweet Author Summary')
      plt.bar(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(tweets, num_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(tweets, num_retweets)
      plt.show()