<commit_before># python libs
from math import *
import cmath
import random


# rasmus libs
import util
import algorithms



# only import this module if available
try:
    import scipy
except ImportError:
    pass



def mean(vals):
    return sum(vals) / float(len(vals))

def median(vals):
    return util.sort(vals)[len(vals) / 2]

def mode(vals):
    top = 0
    topkey = None
    for key, val in util.histDict(vals).iteritems():
        if val > top:
            top = val
            topkey = key
    return topkey

"""
Bad function name

def var(vals):
    u = mean(vals)
    return mean(map(lambda x: (x - u)**2, vals))
"""


def variance(vals):
    u = mean(vals)
    return sum(map(lambda x: (x - u)**2, vals)) / float(len(vals)-1)<commit_msg>*** empty log message ***<commit_after># python libs
from math import *
import cmath
import random


# rasmus libs
import util
import algorithms



# only import this module if available
try:
    import scipy
except ImportError:
    pass



def mean(vals):
    return sum(vals) / float(len(vals))

def median(vals):
    lenvals = len(vals)
    sortvals = util.sort(vals)
    
    if lenvals % 2 == 0:
        return (sortvals[lenvals / 2] + sortvals[lenvals / 2 - 1]) / 2.0
    else:
        return sortvals[lenvals / 2]

def mode(vals):
    top = 0
    topkey = None
    for key, val in util.histDict(vals).iteritems():
        if val > top:
            top = val
            topkey = key
    return topkey

"""
Bad function name

def var(vals):
    u = mean(vals)
    return mean(map(lambda x: (x - u)**2, vals))
"""


def variance(vals):
    u = mean(vals)
    return sum(map(lambda x: (x - u)**2, vals)) / float(len(vals)-1)
{'fraction_non_alphanumeric': 0.1255205234979179, 'fraction_numerical': 0.010113027959547887, 'mean_word_length': 2.578723404255319, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7021251', 'n_tokens_mistral': 593, 'n_tokens_neox': 569, 'n_words': 183}