<commit_before>import WetterKassel
from time import time
from sys import argv , stderr, exit

def main():
    if len(argv) != 2:
        print >> stderr, "[-] Wrong amount of arguments supplied." 
        exit(1)
    if argv[1] == "morning":
        tweettime = 0 # current day
    elif argv[1] == "evening":
        tweettime = 1 #next day
    else: 
        print >> stderr, "[-] Wrong argument(s) supplied." 
        exit(1)
        
    wapi = WetterKassel.weatherapi()
    data = wapi.getdata(dummy=False) # get json weather data
    print "[+][%s] Got Weather Data" % str(time())
    daydata = data["daily"]["data"][tweettime]
    tweetbuilder = WetterKassel.tweetbuild(data=daydata, tweettime=tweettime)
    tweet = tweetbuilder.build()
    print "[+][%s] Built Tweet" % str(time())
    tapi = WetterKassel.twitterapi()
    tapi.post(tweet.encode("utf-8")) # encode to fix issue under linux
    print "[+][%s] Sent Tweet" % str(time())
if __name__ == "__main__":
    main()
<commit_msg>cleanup<commit_after>import WetterKassel
from time import time
from sys import argv , stderr, exit

def main():
    if len(argv) != 2:
        print >> stderr, "[-] Wrong amount of arguments supplied." 
        exit(1)
    if argv[1] == "today":
        tweettime = 0 
    elif argv[1] == "tomorrow":
        tweettime = 1
    else: 
        print >> stderr, "[-] Wrong argument(s) supplied." 
        exit(1)
        
    # Get Data from Weather API
    wapi = WetterKassel.weatherapi()
    data = wapi.getdata(dummy=False) # get json weather data
    print "[+][%s] Got Weather Data" % str(time())
    
    # process data and build tweet
    daydata = data["daily"]["data"][tweettime]
    tweetbuilder = WetterKassel.tweetbuild(data=daydata, tweettime=tweettime)
    tweet = tweetbuilder.build()
    print "[+][%s] Built Tweet" % str(time())

    # post tweet
    tapi = WetterKassel.twitterapi()
    tapi.post(tweet.encode("utf-8")) # encode to fix issue under linux
    print "[+][%s] Sent Tweet" % str(time())
if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.14516129032258066, 'fraction_numerical': 0.007820136852394917, 'mean_word_length': 2.921455938697318, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 11, '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': '3254276', 'n_tokens_mistral': 725, 'n_tokens_neox': 689, 'n_words': 188}