This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import math | |
import shutil | |
import argparse | |
def buildTEX( | |
lc_files: list, | |
output_tex_file: str, | |
nr: int = 4, | |
nc: int = 4, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy | |
import subprocess as sp | |
def get_video_info(video_file): | |
cap = cv2.VideoCapture(video_file) | |
framerate = cap.get(5) #frame rate | |
# Get resolution of input video | |
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from glob import glob | |
import multiprocessing as mp | |
keywords = ['argparse'] | |
main_folder = 'path_to_main_folder' | |
py_files = [] | |
if os.path.isdir(main_folder): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
mb_scale_factor: float = pow(1024, 2) # If you want result expressed in MB | |
def get_dir_size(path: str) -> float: | |
total: int = 0 | |
with os.scandir(path) as it: | |
for entry in it: | |
if entry.is_file(): | |
total += entry.stat().st_size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
from ROOT import TFile | |
def TestROOTFile(path: str = "") -> bool: | |
_tmp_file = TFile(path) | |
if _tmp_file and not _tmp_file.IsOpen(): | |
return False | |
elif _tmp_file and _tmp_file.IsOpen() and _tmp_file.IsZombie(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
_LIST=$1 | |
echo "Reading files in ${_LIST}" | |
while IFS="" read -r line || [ -n "${line}" ] | |
do | |
if [[ -s ${line} ]]; then echo "${line}: NOT EMPTY"; else echo "${line}: EMPTY"; fi | |
cat ${line} >> test_if_empty.txt | |
done < ${_LIST} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
class bcolors: | |
HEADER = '\033[95m' | |
OKBLUE = '\033[94m' | |
OKGREEN = '\033[92m' | |
WARNING = '\033[93m' | |
FAIL = '\033[91m' | |
ENDC = '\033[0m' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SOURCE="$1" | |
EXITPATH="$2" | |
FILE=${SOURCE##*/} | |
BASE=${FILE%.*} | |
echo -e "\e[31mReaching tmp dir...\e[0m" | |
cd /tmp && |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple email notification sender | |
# Developed by Enrico Catanzani | |
# Release 3.2 | |
#!/usr/bin/python3 | |
import smtplib | |
import os.path as op | |
from email.mime.multipart import MIMEMultipart |