<commit_before>from flask import Flask, url_for, Response
import lightSetter

app = Flask(__name__)
lightEngine = lightSetter.lightSetter()

@app.route('/setlights/<red>/<green>/<blue>')
def api_setLights(red, green, blue):
  try:
    lightEngine.setLights((int(red), int(green), int(blue)))
    return 'success'
  except ValueError as e:
    return 'failure'
    print e

@app.route('/setlights/<color>')
def api_setLights_color(color):
  lightEngine.setlights(color)
  return success

if __name__ == '__main__':
  app.run(host='0.0.0.0')
<commit_msg>Adding endpoints to serve webui resources.<commit_after>from flask import Flask, url_for, Response, send_from_directory
import lightSetter

app = Flask(__name__, static_url_path='')
lightEngine = lightSetter.lightSetter()

@app.route('/setlights/<red>/<green>/<blue>')
def api_setLights(red, green, blue):
  try:
    lightEngine.setLights((int(red), int(green), int(blue)))
    return 'success'
  except ValueError as e:
    return 'failure'
    print e

@app.route('/setlights/<color>')
def api_setLights_color(color):
  lightEngine.setlights(color)
  return success

@app.route('/')
def webui():
  return send_from_directory('webui/index.html')

@app.route('/js/sliders.js')
def webui_slider_js():
  return send_from_directory('webui/js/sliders.js')

@app.route('/css/sliders.css')
def webui_slider_js():
  return send_from_directory('webui/css/sliders.css')
  
if __name__ == '__main__':
  app.run(host='0.0.0.0')

{'fraction_non_alphanumeric': 0.1524846834581348, 'fraction_numerical': 0.005445881552076242, 'mean_word_length': 5.363636363636363, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '147318', 'n_tokens_mistral': 530, 'n_tokens_neox': 521, 'n_words': 104}