<commit_before>#!/usr/bin/env python
import cgi
import cgitb; cgitb.enable()  # for troubleshooting
import os
from hashlib import sha256
import hmac
from collections import defaultdict

SHARED_SECRET_KEY = 'BESURETODRINKYOUROVALTINE'
def authenticate_with_codepuppy(token, forward_url, verify_url):
  sunetid = os.environ['REMOTE_USER']
  h = hmac.new(SHARED_SECRET_KEY, "{0},{1}".format(token, sunetid), sha256)
  url = "{0}token={1}&user_system_id={2}&hmac={3}&forward_url={4}"
  url = url.format(verify_url, token, sunetid, h.hexdigest(), forward_url)
  print("Location:{0}".format(url))
  print("")

def main():
  form = cgi.FieldStorage()
  token = form.getvalue("token")
  forward_url = form.getvalue("forward_url")<commit_msg>another tiny fix<commit_after>#!/usr/bin/env python
import cgi
import cgitb; cgitb.enable()  # for troubleshooting
import os
from hashlib import sha256
import hmac
from collections import defaultdict

SHARED_SECRET_KEY = 'BESURETODRINKYOUROVALTINE'
def authenticate_with_codepuppy(token, forward_url, verify_url):
  sunetid = os.environ['REMOTE_USER']
  h = hmac.new(SHARED_SECRET_KEY, "{0},{1}".format(token, sunetid), sha256)
  url = "{0}?token={1}&user_system_id={2}&hmac={3}&forward_url={4}"
  url = url.format(verify_url, token, sunetid, h.hexdigest(), forward_url)
  print("Location:{0}".format(url))
  print("")

def main():
  form = cgi.FieldStorage()
  token = form.getvalue("token")
  forward_url = form.getvalue("forward_url")
{'fraction_non_alphanumeric': 0.14761904761904762, 'fraction_numerical': 0.01904761904761905, 'mean_word_length': 6.701570680628272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '181007', 'n_tokens_mistral': 575, 'n_tokens_neox': 548, 'n_words': 105}