one-file convenient code for simple logging.
- c++11 compatible
 - header only
 - type-safe formatting
 
| from PIL import Image | |
| def resize_and_crop(img_path, modified_path, size, crop_type="top"): | |
| """ | |
| Resize and crop an image to fit the specified size. | |
| args: | |
| img_path: path for the image to resize. | |
| modified_path: path to store the modified image. | 
| //------------------------------------------------------------------------------ | |
| // <auto-generated> | |
| // 此代码由工具生成。 | |
| // 运行时版本:4.0.30319.42000 | |
| // | |
| // 对此文件的更改可能会导致不正确的行为,并且如果 | |
| // 重新生成代码,这些更改将会丢失。 | |
| // </auto-generated> | |
| //------------------------------------------------------------------------------ | 
| import aiohttp | |
| import asyncio | |
| import socket | |
| import time | |
| import os | |
| def getUrls(rid, count, directory): | |
| url = f"http://wt-game-replays.warthunder.com/{rid}/" | |
| urlList = [] | |
| pathList = [] | 
| import os | |
| import click | |
| import re | |
| import csv | |
| import numpy as np | |
| from selenium import webdriver | |
| from bs4 import BeautifulSoup | |
| from urllib.parse import quote_plus | |
| YOUTUBE_QUERY = 'https://www.youtube.com/results?search_query=' | 
| import click | |
| import time | |
| import timeout_decorator | |
| import subprocess | |
| import requests | |
| import datetime | |
| import socket | |
| import re | |
| from PIL import Image, ImageFont, ImageDraw | |
| from stl import mesh | |
| from mpl_toolkits import mplot3d | |
| from matplotlib import pyplot as plt | |
| from cv2 import cv2 | |
| import itertools as its | |
| import numpy as np | |
| import random | |
| import sys |