<commit_before>import cv2

'''
	from ticket import ticket
	t = ticket()
	t.fps()
'''

class ticket(object):

    def __init__(self):
        self._count     = 0
        self._oldCount  = 0
        self._freq      = 1000 / cv2.getTickFrequency()
        self._startTime = cv2.getTickCount()

    def fps(self):
        nowTime         = cv2.getTickCount()
        diffTime        = (nowTime - self._startTime) * self._freq
        self._startTime = nowTime
        fps             = (self._count - self._oldCount) / (diffTime / 1000.0)
        self._oldCount  = self._count
        self._count     += 1
        fpsRounded      = round(fps, 1)
        return fpsRounded<commit_msg>Added calculating opencv fps<commit_after># -*- coding: utf-8 -*-
#
# ticket.py
#
# Usage:
#       from ticket import ticket
#       t = ticket()
#       t.display()
#
import sys
import cv2

class ticket(object):

    def __init__(self):
        self._step = 3
        self._frameCount = 0
        self._freq = cv2.getTickFrequency()
        self._prevFrameTime = cv2.getTickCount()

    def fps(self):
        self._frameCount += 1
        nowFrameTime = cv2.getTickCount()
        fps = self._freq / (nowFrameTime - self._prevFrameTime)
        self._prevFrameTime = nowFrameTime
        fpsRounded      = round(fps, 1)
        return fpsRounded

    def display(self):
        sys.stdout.write("\rfps:{}".format(self.fps()))
        if (self._frameCount%self._step==0):
            sys.stdout.flush()
{'fraction_non_alphanumeric': 0.11808367071524967, 'fraction_numerical': 0.018218623481781375, 'mean_word_length': 1.9839034205231387, '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': '3036127', 'n_tokens_mistral': 493, 'n_tokens_neox': 466, 'n_words': 99}