<commit_before>"""Find top stocks and post them to Twitter."""
import sys
import tweetPoster
import stockPrices
from stockList import getStockList
import time

def main():
    # Get the list of stock symobls
    currentStockList = getStockList()

    # Get the stock prices
    oldStockPrices = stockPrices.getStockPrices(currentStockList)

    # Wait a while for the stock prices to change
    print("Sleeping...")
    time.sleep(30)
    print("Done sleeping.")

    # Get the new stock prices
    currentStockPrices = stockPrices.getStockPrices(currentStockList)

    # Find the fastest-changing stocks
    topStockPrices = stockPrices.getFastestChangingPrices(currentStockPrices, oldStockPrices)

    # Format the tweet text
    tweetText = ""
    for stockPrice in topStockPrices:
        symbol  = stockPrice[0]
        percentage = round(float(stockPrice[1]), 2)
        if percentage > 0:
            percentage = '+' + str(percentage)
        tweetText = tweetText + '#' + symbol + " : " + percentage + '%, '

    # Post a tweet of the top stocks
    print tweetText
    tweetPoster.postTweet(tweetText)

if __name__ == '__main__':
    sys.exit(main())<commit_msg>Make sure "percentage" is a string before concatenating it.<commit_after>"""Find top stocks and post them to Twitter."""
import sys
import tweetPoster
import stockPrices
from stockList import getStockList
import time

def main():
    # Get the list of stock symobls
    currentStockList = getStockList()

    # Get the stock prices
    oldStockPrices = stockPrices.getStockPrices(currentStockList)

    # Wait a while for the stock prices to change
    print("Sleeping...")
    time.sleep(30)
    print("Done sleeping.")

    # Get the new stock prices
    currentStockPrices = stockPrices.getStockPrices(currentStockList)

    # Find the fastest-changing stocks
    topStockPrices = stockPrices.getFastestChangingPrices(currentStockPrices, oldStockPrices)

    # Format the tweet text
    tweetText = ""
    for stockPrice in topStockPrices:
        symbol  = stockPrice[0]
        percentage = round(float(stockPrice[1]), 2)
        if percentage > 0:
            percentage = '+' + str(percentage)
        else:
            percentage = str(percentage)
        tweetText = tweetText + '#' + symbol + " : " + percentage + '%, '

    # Post a tweet of the top stocks
    print tweetText
    tweetPoster.postTweet(tweetText)

if __name__ == '__main__':
    sys.exit(main())
{'fraction_non_alphanumeric': 0.08875255623721881, 'fraction_numerical': 0.0049079754601227, 'mean_word_length': 3.2318339100346023, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '708176', 'n_tokens_mistral': 759, 'n_tokens_neox': 706, 'n_words': 210}