<commit_before>from picamera import PiCamera
from time import sleep
import threading
import os

class camera:
    def __init__(self):
        #testing only
        self.camera="camera"
        self.count=0
        self.w=2592
        self.h=1944
        self.busy=False

    def takeShot(self):
        #t=threading.Thread(target=self.take(),args=())
        #t.daemon=True
        #t.start()
        #t.join()
        self.take()
        sleep(2)
        print("Shot taken")

    def take(self):
        os.system("v4l2-ctl --set-fmt-video=width=" + str(self.w) + ",height=" + str(self.h) + ",pixelformat=3")
        os.system("v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=/home/pi/camera/img" + str(self.count) + ".jpg")
        os.system("v4l2-ctl --set-fmt-video=width=720,height=480,pixelformat=H264 -p 30")
        self.count+=1


    def recording(self,state):
        if(state ==  '0'):
            self.stopRecording()
        else:
            self.startRecording()
    def startRecording(self):
        print("Recording on")

    def stopRecording(self):
        print("Recording off")<commit_msg>Code optimization, general developement<commit_after>from picamera import PiCamera
from time import sleep
import threading
import os

class camera:
    def __init__(self):
        #testing only
        self.camera="camera"
        self.count=0
        self.w=2592
        self.h=1944
        self.busy=False

    def takeShot(self):
        #t=threading.Thread(target=self.take(),args=())
        #t.daemon=True
        #t.start()
        #t.join()
        sleep(1)
        self.take()
        sleep(1)
        print("Shot taken")

    def take(self):
        os.system("v4l2-ctl --set-fmt-video=width=" + str(self.w) + ",height=" + str(self.h) + ",pixelformat=3")
        os.system("v4l2-ctl --stream-mmap=3 --stream-count=1 --stream-to=/home/pi/camera/img" + str(self.count) + ".jpg")
        os.system("v4l2-ctl --set-fmt-video=width=720,height=480,pixelformat=H264 -p 30")
        self.count+=1


    def recording(self,state):
        if(state ==  '0'):
            self.stopRecording()
        else:
            self.startRecording()
    def startRecording(self):
        print("Recording on")

    def stopRecording(self):
        print("Recording off")
{'fraction_non_alphanumeric': 0.15151515151515152, 'fraction_numerical': 0.02854633289415898, 'mean_word_length': 2.268292682926829, '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': '185171', 'n_tokens_mistral': 802, 'n_tokens_neox': 755, 'n_words': 137}