<commit_before>import cv2
from PIL import Image
import pytesseract

def process_video(file):
  vid = cv2.VideoCapture(file)
  speed = 3

  count = 0
  ret = []
  while True:
    success, image = vid.read()

    if not success:
      break

    vid.set(cv2.CAP_PROP_POS_FRAMES, vid.get(cv2.CAP_PROP_POS_FRAMES) + vid.get(cv2.CAP_PROP_FPS) * speed)
    print('Reading a new frame ..', count)

    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    cv2.imwrite('./images/frame{}.jpg'.format(count), gray)
    ret.append(process_picture('./images/frame{}.jpg'.format(count)))
    count += 1

  return ret
<commit_msg>timestamp<commit_after>import cv2
from PIL import Image
import pytesseract

def process_video(file):
  vid = cv2.VideoCapture(file)
  speed = 3

  count = 0
  ret = []
  while True:
    success, image = vid.read()

    if not success:
      break

    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
    cv2.imwrite('./images/frame{}.jpg'.format(count), gray)
    ret.append((
      timestamp(vid.get(cv2.CAP_PROP_POS_FRAMES) / vid.get(cv2.CAP_PROP_FPS)),
      process_picture('./images/frame{}.jpg'.format(count))
    ))
    count += 1

    vid.set(cv2.CAP_PROP_POS_FRAMES, vid.get(cv2.CAP_PROP_POS_FRAMES) + vid.get(cv2.CAP_PROP_FPS) * speed)

  return ret

def timestamp(seconds):
  print(seconds)
  return int(seconds)

{'fraction_non_alphanumeric': 0.1347305389221557, 'fraction_numerical': 0.019461077844311378, 'mean_word_length': 3.5016835016835017, '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': '2678858', 'n_tokens_mistral': 512, 'n_tokens_neox': 496, 'n_words': 93}