input: Write a python function to calculate the average sentiment score of tweets based on a given query.
  assert calculate_average_sentiment("happy") == 0.5  # Example value, replace with actual expected result
  assert calculate_average_sentiment("sad") == -0.5  # Example value, replace with actual expected result
  assert calculate_average_sentiment("neutral") == 0.0  # Example value, replace with actual expected result
output: def calculate_average_sentiment(query):
      import tweepy
      from textblob import TextBlob
      
      # Replace these with your own credentials
      consumer_key = 'your_consumer_key'
      consumer_secret = 'your_consumer_secret'
      access_token = 'your_access_token'
      access_token_secret = 'your_access_token_secret'
  
      # Set up tweepy authentication
      auth = tweepy.OAuth1UserHandler(consumer_key, consumer_secret, access_token, access_token_secret)
      api = tweepy.API(auth)
  
      # Search for tweets containing the query
      tweets = api.search(q=query, count=100, lang='en')
  
      # Calculate sentiment scores
      sentiment_scores = [TextBlob(tweet.text).sentiment.polarity for tweet in tweets]
  
      # Calculate average sentiment score
      if sentiment_scores:
          average_sentiment = sum(sentiment_scores) / len(sentiment_scores)
      else:
          average_sentiment = 0.0
  
      return average_sentiment