<commit_before>import web
import json
import os
import random
from jinja2 import Template
import urllib
import subprocess
import shlex
import textwrap
import settings
import datetime
import databaseconnect
import logger

" Load Data "
with open("./data/data.json") as f:
    meps = json.load(f)

db = databaseconnect.connect(settings.DATABASE_URL)

def weighted_choice(ff=lambda x: x):
    """ Pick a MEP based on the score weight """
    lm = filter(ff,meps)
    ts = sum((i['score'] for i in lm))
    r = random.uniform(0,ts)
    n = 0<commit_msg>make it executable<commit_after>#!/usr/bin/python
import web
import json
import os
import random
from jinja2 import Template
import urllib
import subprocess
import shlex
import textwrap
import settings
import datetime
import databaseconnect
import logger

" Load Data "
with open("./data/data.json") as f:
    meps = json.load(f)

db = databaseconnect.connect(settings.DATABASE_URL)

def weighted_choice(ff=lambda x: x):
    """ Pick a MEP based on the score weight """
    lm = filter(ff,meps)
    ts = sum((i['score'] for i in lm))
    r = random.uniform(0,ts)
    n = 0
{'fraction_non_alphanumeric': 0.09901873327386262, 'fraction_numerical': 0.0053523639607493305, 'mean_word_length': 4.123287671232877, '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': '1611782', 'n_tokens_mistral': 371, 'n_tokens_neox': 360, 'n_words': 126}