<commit_before>from sys import argv, exit

import functions as f

if len(argv) != 2:
    print 'usage: %s <upc>' % argv[0]
    exit(-1)
    
upc = argv[1]

f.log(upc)

if upc[0] == '4':
    
    if upc[6] == '1':
        
        # user ID card scanned
        
        f.update_user(int(upc[-5:-1]))
        
    if upc[6] == '2':
        
        # nullary command functions
        
        cmd_id = int(upc[-5:-1])
        
        if cmd_id == 1:
            
            from subprocess import call
            call(['git', 'pull'])
            
elif upc[0] in [str(i) for i in [0,1,6,7,8]]:
    
    user = f.get_user()
    username = ((user.twitter_handle if user.twitter_handle
                 else user.name) if user
                else 'Somebody')
    beveragename = f.get_beverage_description(upc)
    print 'beveragename: ', beveragename
    if not beveragename: beveragename = 'something'
    
    f.twitter_post('%s grabbed a %s' % (username, beveragename))
    
else:
    
    print 'don\'t know what that is'<commit_msg>twitter username annotation<commit_after>from sys import argv, exit

import functions as f

if len(argv) != 2:
    print 'usage: %s <upc>' % argv[0]
    exit(-1)
    
upc = argv[1]

f.log(upc)

if upc[0] == '4':
    
    if upc[6] == '1':
        
        # user ID card scanned
        
        f.update_user(int(upc[-5:-1]))
        
    if upc[6] == '2':
        
        # nullary command functions
        
        cmd_id = int(upc[-5:-1])
        
        if cmd_id == 1:
            
            from subprocess import call
            call(['git', 'pull'])
            
elif upc[0] in [str(i) for i in [0,1,6,7,8]]:
    
    user = f.get_user()
    username = (('.@' + user.twitter_handle if user.twitter_handle
                 else user.name) if user
                else 'Somebody')
    beveragename = f.get_beverage_description(upc)
    print 'beveragename: ', beveragename
    if not beveragename: beveragename = 'something'
    
    f.twitter_post('%s grabbed a %s' % (username, beveragename))
    
else:
    
    print 'don\'t know what that is'
{'fraction_non_alphanumeric': 0.13101476893758932, 'fraction_numerical': 0.020009528346831826, 'mean_word_length': 1.770448548812665, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6548096', 'n_tokens_mistral': 744, 'n_tokens_neox': 734, 'n_words': 185}