<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web,creds
import smtplib
import email.utils
from email.mime.text import MIMEText

urls = ( '/','Index', '/contact/','Contact' )
index = open('index.html','r')
data = index.read()
index.close()

class Index:
  def GET(self):
    global data
    return data

class Contact:
  def GET(self):
    web.redirect('/')
  def POST(self):
    #Connect to the SMTP server
    sender = smtplib.SMTP()
    sender.connect('smtp.gmail.com',587)
    #gmail auth methods
    sender.ehlo();sender.starttls();sender.ehlo()
    sender.login(creds.email,creds.password)
    try:
      form = web.input()
      captcha = form['g-recaptcha-response ']
      if captcha == "": web.redirect('/')
      body = form['message']+"\n\nisim: "+form['name']+"\ne-posta: "+form['email']
      message = MIMEText(body,'plain','utf-8')
      message['To'] = email.utils.formataddr(('Recipient', '<EMAIL>'))
      message['From'] = email.utils.formataddr(('Author', form['email']))
      message['Subject'] = 'ORKESTRA: %s'%form['topic']
      sender.sendmail(form['email'], ['<EMAIL>','<EMAIL>','<EMAIL>'], message.as_string())
    finally:
      sender.quit()
      web.redirect('/')

if __name__ == "__main__": 
  web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
  app = web.application(urls, globals())
  app.run()<commit_msg>decaptcha<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import web,creds
import smtplib
import email.utils
from email.mime.text import MIMEText

urls = ( '/','Index', '/contact/','Contact' )
index = open('index.html','r')
data = index.read()
index.close()

class Index:
  def GET(self):
    global data
    return data

class Contact:
  def GET(self):
    web.redirect('/')
  def POST(self):
    #Connect to the SMTP server
    sender = smtplib.SMTP()
    sender.connect('smtp.gmail.com',587)
    #gmail auth methods
    sender.ehlo();sender.starttls();sender.ehlo()
    sender.login(creds.email,creds.password)
    try:
      form = web.input()
      #captcha = form['g-recaptcha-response ']
      #if captcha == "": web.redirect('/')
      body = form['message']+"\n\nisim: "+form['name']+"\ne-posta: "+form['email']
      message = MIMEText(body,'plain','utf-8')
      message['To'] = email.utils.formataddr(('Recipient', '<EMAIL>'))
      message['From'] = email.utils.formataddr(('Author', form['email']))
      message['Subject'] = 'ORKESTRA: %s'%form['topic']
      sender.sendmail(form['email'], ['<EMAIL>','<EMAIL>','<EMAIL>'], message.as_string())
    finally:
      sender.quit()
      web.redirect('/')

if __name__ == "__main__": 
  web.wsgi.runwsgi = lambda func, addr=None: web.wsgi.runfcgi(func, addr)
  app = web.application(urls, globals())
  app.run()
{'fraction_non_alphanumeric': 0.20014450867052022, 'fraction_numerical': 0.0036127167630057803, 'mean_word_length': 3.701188455008489, 'pattern_counts': {'":': 4, '<': 11, '<?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': '7165548', 'n_tokens_mistral': 982, 'n_tokens_neox': 970, 'n_words': 183}