This file contains 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
# Ultralytics YOLO 🚀, GPL-3.0 license | |
# https://gist.github.com/glenn-jocher/85b1fe5325d73971783e16b7721b81f7 | |
import contextlib | |
import re | |
import warnings | |
from collections import Counter | |
import requests | |
from tqdm import tqdm |
This file contains 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
""" | |
Python Files Analyzer | |
This script analyzes Python files in a given GitHub repo, excluding specified sub-directories. | |
It counts and reports the following for each file: | |
- Total number of characters | |
- Total number of words | |
- Total number of lines | |
- Total number of functions (based on the 'def' keyword) | |
- Total number of classes (based on the 'class' keyword) |
This file contains 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
""" | |
This script recursively scans Python files within a specified directory to identify functions and classes | |
that lack docstrings. | |
Features: | |
- Can navigate deeply nested directory structures to analyze all `.py` files. | |
- Allows for specific directories (like `venv` or `runs`) to be excluded from the scan. | |
- For each missing docstring, the script outputs the file path and the specific function or class declaration. | |
- Provides a summary count of total functions/classes analyzed, how many have docstrings, and how many are missing them. | |
- Offers an overview of the number of missing docstrings categorized by the top-level directory. |
This file contains 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
""" | |
iOS App Store Preview Image Resizer | |
This script provides functionality to resize images for iOS app store previews. It offers two modes for resizing: | |
- "pad": This mode will pad the image with white space to fit the target dimensions without cropping. | |
- "crop": This mode will crop the image to match the target aspect ratio, then resize it to the exact target dimensions. | |
Usage: | |
- Modify the `input_dir` variable to point to the directory containing the images you want to resize. | |
- The script will create output directories named with the target dimensions and the device name. |
This file contains 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
# M3 Macbook Air results: | |
# Average Threading Time: 0.38 seconds | |
# Average Multiprocessing Time: 2.39 seconds | |
# Average Concurrent Futures (ThreadPool) Time: 0.34 seconds | |
# Average Concurrent Futures (ProcessPool) Time: 2.39 seconds | |
import time | |
import torch | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor |