Add this to Visual Studio Code
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 logging | |
| INFO = logging.INFO | |
| DEBUG = logging.DEBUG | |
| WARNING = logging.WARNING | |
| def create_logger(logger_name, log_level=logging.WARNING, filename=None): | |
| """ Create a logger that log to the console, if a filename is | |
| supplied, log to that file as well. |
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
| [tool.mypy] | |
| check_untyped_defs = true | |
| ignore_missing_imports = true | |
| pretty = true | |
| show_error_codes = true | |
| warn_return_any = true |
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
| lint: | |
| @uv run ruff check --select I --fix . --quiet | |
| @uv run ruff format . --quiet | |
| @uv run ruff check . --fix --quiet |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
| """ | |
| Generate the repr for a class | |
| """ | |
| import argparse | |
| import io | |
| import subprocess | |
| import platform | |
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
| def strip_accents(text): | |
| """ | |
| Strips the accents, replace the dd, and lower case | |
| """ | |
| text = text.replace("đ", "d").replace("Đ", "d") | |
| text = unicodedata.normalize("NFD", text) | |
| text = text.encode("ascii", "ignore") | |
| text = text.decode("utf-8") | |
| text = text.lower() | |
| return text |
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
| # Detect platform in bash | |
| # https://stackoverflow.com/a/3466183/459745 | |
| case $(uname -s) in | |
| Linux*) platform=Linux;; | |
| Darwin*) platform=Mac;; | |
| CYGWIN*) platform=Cygwin;; | |
| MINGW*) platform=MinGw;; | |
| *) platform=Unknown;; | |
| esac |
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 python | |
| # -*- coding: utf-8 -*- | |
| """ | |
| This script takes in a single parameter representing a directory | |
| and traverse that directory to list the exceptions that are ignored. | |
| """ | |
| from __future__ import print_function | |
| import ast | |
| import os | |
| import sys |
NewerOlder