<commit_before>import serial 
import time
import requests
import json
import sys

job_limit = 16
max_job = job_limit - 1

token = sys.argv[1]
url = 'https://circleci.com/api/v1.1/recent-builds?circle-token=' + token + '&limit=' + str(job_limit) + '&offset=0'
request_frequency = 15

s = None

switcher = {                            
  "failed": "red",                       
  "success": "green",                    
  "finished": "green",                 
  "fixed": "blue",                       
  "no_tests": "gray",                    
  "retried": "orange",                  
  "timedout":"yellow\0blink",            
  "canceled":"pink",                   
  "not_run":"gray",             
  "running":"ltblue\0breathe",               
  "queued":"magenta\0breathe",                
  "scheduled":"purple",           
  "not_running":"white\0blink",          
  "infrastructure_fail":"white\0blink",
  "missing":"gray",                    
  "spacer":"black",
  "masterfailed":"red\0blink"                       
}   

def setup(): 
  global s 
  s = serial.Serial("/dev/ttyS0", 57600) 
  s.write("erase\0".encode())

inter_command_delay = 0.01

def command(cmd_text):
  s.write((cmd_text + '\0').encode())   
  time.sleep(inter_command_delay)                       

def color_command(color_cmd_text):                     
  color_cmd = switcher.get(color_cmd_text, "black")  
  command(color_cmd)
                                          
def spacer():                              
  color_command("spacer") 

def loop():
  r = requests.get(url)
  r = r.text.encode('utf-8')
  j = json.loads(r)

  command("pause");

  for x in range(0, job_limit):
    st = j[max_job - x]['status']

#    print "st: " + st

    if st == 'failed':
      br = j[max_job - x]['branch']
      if br == 'master':
        color_command('masterfailed')
        color_command('masterfailed')
        color_command('masterfailed')
      else: 
        color_command('failed')
        color_command('failed')
        color_command('failed')
    elif st == 'success':
      color_command('success')
      color_command('success')
      color_command('success')
    elif st == 'running':
      color_command('running')           
      color_command('running')           
      color_command('running')  
    else:
      lc = j[max_job - x]['lifecycle']               
      oc = j[max_job - x]['outcome']  
<commit_msg>tweaking colors and effects related to specific situations<commit_after>import serial 
import time
import requests
import json
import sys

job_limit = 18
max_job = job_limit - 1

token = sys.argv[1]
url = 'https://circleci.com/api/v1.1/recent-builds?circle-token=' + token + '&limit=' + str(job_limit) + '&offset=0'
request_frequency = 15

s = None

switcher = {                            
  "failed": "red",                       
  "success": "green",                    
  "finished": "green",                 
  "fixed": "orange",                       
  "no_tests": "gray",                    
  "retried": "yellow",                  
  "timedout":"yellow\0blink",            
  "canceled":"pink",                   
  "not_run":"gray",             
  "running":"ltblue\0breathe",               
  "queued":"magenta\0breathe",                
  "scheduled":"purple",           
  "not_running":"white\0blink",          
  "infrastructure_fail":"white\0blink",
  "missing":"gray",                    
  "spacer":"black",
  "masterfailed":"red\0blink",
  "masterfixed":"green\0blink"                       
}   

def setup(): 
  global s 
  s = serial.Serial("/dev/ttyS0", 57600) 
  s.write("erase\0".encode())

inter_command_delay = 0.01

def command(cmd_text):
  s.write((cmd_text + '\0').encode())   
  time.sleep(inter_command_delay)                       

def color_command(color_cmd_text):                     
  color_cmd = switcher.get(color_cmd_text, "black")  
  command(color_cmd)
                                          
def spacer():                              
  color_command("spacer") 

def loop():
  r = requests.get(url)
  r = r.text.encode('utf-8')
  j = json.loads(r)

  command("pause");

  for x in range(0, job_limit):
    st = j[max_job - x]['status']

#    print "st: " + st

    br = j[max_job - x]['branch']
    rp = j[max_job - x]['reponame']
    master = br == 'master'
    orders = rp == 'orders'
    orders_master = master and orders

    if st == 'failed':
      if orders_master:
        color_command('masterfailed')
        color_command('masterfailed')
        color_command('masterfailed')
      else: 
        color_command('failed')
        color_command('failed')
        color_command('failed')
    elif st == 'success':
      color_command('success')
      color_command('success')
      color_command('success')
    elif st == 'running':
      color_command('running')           
      color_command('running')           
      color_command('running')  
    elif st == 'fixed':
      if orders_master:
        color_command('masterfixed')                                                                               
        color_command('masterfixed')               
        color_command('masterfixed')               
      else:
        color_command('fixed')               
        color_command('fixed')                     
        color_command('fixed')                     
    else:
      lc = j[max_job - x]['lifecycle']               
      oc = j[max_job - x]['outcome']  

{'fraction_non_alphanumeric': 0.13682277318640956, 'fraction_numerical': 0.01046831955922865, 'mean_word_length': 1.6735395189003437, 'pattern_counts': {'":': 35, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '70532', 'n_tokens_mistral': 1675, 'n_tokens_neox': 1597, 'n_words': 292}