<commit_before>import ure as re
import logging
logging.basicConfig(level=logging.INFO)

import picoweb
import config
import ap
import sta
import pwm
import gpio
import util

routes = [
  ('/cfg', util.handler(config.crud)),
  ('/cfg/reset', util.handler(config.reset)),
  ('/cfg/factory', util.handler(config.factory)),
  ('/sta', util.handler(sta.crud)),
  ('/sta/scan', util.handler(sta.scan)),
  ('/ap', util.handler(ap.crud)),
  ('/pwm', util.handler(pwm.list)),
  (re.compile('^/pwm/(\w+)$'), util.handler(pwm.crud)),
  (re.compile('^/pwm/(\w+)/duty$'), util.handler(pwm.duty)),
  ('/gpio', util.handler(gpio.list)),
  (re.compile('^/gpio/(\w+)$'), util.handler(gpio.crud)),
  (re.compile('^(.*)$'), util.handler(util.static))
]
app = picoweb.WebApp(__name__, routes, False)
app.run(host="0.0.0.0", port=80)<commit_msg>call gpio.model.setup to initialize defined gpio pins<commit_after>import ure as re
import logging
logging.basicConfig(level=logging.INFO)

import picoweb
import config
import ap
import sta
import pwm
import gpio
import util

gpio.model.setup()

routes = [
  ('/cfg', util.handler(config.crud)),
  ('/cfg/reset', util.handler(config.reset)),
  ('/cfg/factory', util.handler(config.factory)),
  ('/sta', util.handler(sta.crud)),
  ('/sta/scan', util.handler(sta.scan)),
  ('/ap', util.handler(ap.crud)),
  ('/pwm', util.handler(pwm.list)),
  (re.compile('^/pwm/(\w+)$'), util.handler(pwm.crud)),
  (re.compile('^/pwm/(\w+)/duty$'), util.handler(pwm.duty)),
  ('/gpio', util.handler(gpio.ctl.list)),
  (re.compile('^/gpio/(\w+)$'), util.handler(gpio.ctl.crud)),
  (re.compile('^(.*)$'), util.handler(util.static))
]
app = picoweb.WebApp(__name__, routes, False)
app.run(host="0.0.0.0", port=80)
{'fraction_non_alphanumeric': 0.23892773892773891, 'fraction_numerical': 0.006993006993006993, 'mean_word_length': 4.900343642611684, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7007503', 'n_tokens_mistral': 670, 'n_tokens_neox': 637, 'n_words': 110}