def extract_data(drug, statuses):
    """Extracts the desired data from a list of twitter responses.

    Arguments:
        drug {str} -- the drug name that corresponds to the statuses.
        statuses {list} -- twitter statuses that were the result of searching for 'drug'.

    Returns:
        [list] -- a list of dictionaries containing the desired data for each tweet.
    """
    tweets = []
    for status in statuses:
        tweet = {
            'drug': drug,
            'tweet_id': status['id'],
            'user_id': status['user']['id'],
            'username': status['user']['screen_name'],
        }

        if status['retweeted'] == True:
            tweet['text'] = status['retweeted_status']['full_text']
        else:
            tweet['text'] = status['full_text']

        tweets.append(tweet)

    return tweets