<commit_before>import sqlite3
import math

import perf
from six.moves import xrange


# the goal of the benchmark is to test CFFI performance and going back and
# forth between SQLite and Python a lot. Therefore the queries themselves are
# really simple

class AvgLength(object):

    def __init__(self):
        self.sum = 0
        self.count = 0

    def step(self, x):
        if x is not None:
            self.count += 1
            self.sum += len(x)<commit_msg>sqlite synth: convert comment to docstring<commit_after>"""
SQLite benchmark.

The goal of the benchmark is to test CFFI performance and going back and forth
between SQLite and Python a lot. Therefore the queries themselves are really
simple.
"""

import sqlite3
import math

import perf
from six.moves import xrange


class AvgLength(object):

    def __init__(self):
        self.sum = 0
        self.count = 0

    def step(self, x):
        if x is not None:
            self.count += 1
            self.sum += len(x)
{'fraction_non_alphanumeric': 0.06861755802219979, 'fraction_numerical': 0.008072653884964682, 'mean_word_length': 2.6204379562043796, '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': '2545697', 'n_tokens_mistral': 297, 'n_tokens_neox': 277, 'n_words': 123}