<commit_before>import os
import glob
import hashlib
import random, string
import time

videoInfo = {'path': "", 'audio_name': "", 'video_name': "", 'final_name': ""}
##Sample videoInfo
#videoInfo = {'final_name': u'C:\\Users\\maleficarium/Desktop\\- -bMftWj-e2T4.mp4', 'path': 'C:\\Users\\maleficarium/Desktop/', 'video_name': 'C:\\Users\\maleficarium/Desktop/937bcebcc1c100815b2c75536ee6724afd07ec61f07c76d6c670ae23.mp4', 'audio_name': 'C:\\Users\\maleficarium/Desktop/4cf3614c8e8619703ed6c6ddfaddd19d31ba4ad4cd600d301123ce28.m4a', 'vid_name': ''}


def videoMerge(path, audio, video, final):
	videoInfo = {'path': path, 'audio_name': audio, 'video_name': video, 'final_name': final}
	videoInfo['audio_name'] = hashRename(videoInfo['path'], audio, ".m4a")
	videoInfo['video_name'] = hashRename(videoInfo['path'], video, ".mp4")
	mergeVid(videoInfo)


def randomword(length):
   return ''.join(random.choice(string.lowercase) for i in range(length))


#Hash the file names to drop unicode characters for FFMPEG
def hashRename(filePath, fileN, ext):
	fileHash = hashlib.sha224(fileN.encode('utf-8')).hexdigest()
	hash_name = filePath+fileHash+ext
	os.rename(fileN, hash_name)
	return hash_name


#Merge the video files and rename the output to the stored filename.
def mergeVid(info):
	out_name = info['path']+randomword(20)+".mp4"
	os.system("ffmpeg -i \"" + info['audio_name'] + "\" -i \"" + info['video_name'] + "\" -c copy \"" + out_name + "\"")
	os.rename(out_name, info['final_name'])<commit_msg>Cleanup<commit_after>import os
import glob
import hashlib
import random, string
import time

videoInfo = {'path': "", 'audio_name': "", 'video_name': "", 'final_name': ""}
##Sample videoInfo
#videoInfo = {'final_name': u'C:\\Users\\maleficarium/Desktop\\- -bMftWj-e2T4.mp4', 'path': 'C:\\Users\\maleficarium/Desktop/', 'video_name': 'C:\\Users\\maleficarium/Desktop/937bcebcc1c100815b2c75536ee6724afd07ec61f07c76d6c670ae23.mp4', 'audio_name': 'C:\\Users\\maleficarium/Desktop/4cf3614c8e8619703ed6c6ddfaddd19d31ba4ad4cd600d301123ce28.m4a'}


def videoMerge(path, audio, video, final):
	videoInfo = {'path': path, 'audio_name': audio, 'video_name': video, 'final_name': final}
	videoInfo['audio_name'] = hashRename(videoInfo['path'], audio, ".m4a")
	videoInfo['video_name'] = hashRename(videoInfo['path'], video, ".mp4")
	mergeVid(videoInfo)


def randomword(length):
   return ''.join(random.choice(string.lowercase) for i in range(length))


#Hash the file names to drop unicode characters for FFMPEG
def hashRename(filePath, fileN, ext):
	fileHash = hashlib.sha224(fileN.encode('utf-8')).hexdigest()
	hash_name = filePath+fileHash+ext
	os.rename(fileN, hash_name)
	return hash_name


#Merge the video files and rename the output to the stored filename.
def mergeVid(info):
	out_name = info['path']+randomword(20)+".mp4"
	os.system("ffmpeg -i \"" + info['audio_name'] + "\" -i \"" + info['video_name'] + "\" -c copy \"" + out_name + "\"")
	os.rename(out_name, info['final_name'])
{'fraction_non_alphanumeric': 0.174496644295302, 'fraction_numerical': 0.053691275167785234, 'mean_word_length': 6.148681055155875, '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': '5535957', 'n_tokens_mistral': 1211, 'n_tokens_neox': 1122, 'n_words': 214}