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
| difflib | |
| textwrap | |
| datetime | |
| calendar | |
| collections (not collections.abc) | |
| heapq | |
| bisect | |
| array | |
| pprint | |
| enum |
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 functools | |
| def debug(message="*** DEBUG"): | |
| def wrapper(func): | |
| @functools.wraps(func) | |
| def inner(*p, **kw): | |
| print(message) | |
| return func(*p, **kw) | |
| return inner | |
| return wrapper |
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 foo_printer(foo) | |
| def inner(): | |
| print(foo) | |
| return inner | |
| printer = foo_printer("foo!") | |
| printer() # prints foo |
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, ArgumentTypeError | |
| from collections import defaultdict | |
| from hashlib import sha3_224 as sha3 | |
| from itertools import chain | |
| from pathlib import Path | |
| from re import split | |
| def keep_input(default, dupe): | |
| while 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
| import datetime | |
| import math | |
| import sys | |
| def main(argv): | |
| try: | |
| goal = int(argv[1]) | |
| current = float(argv[2]) | |
| except: | |
| return f"Usage: {argv[0]} <goal:int> <current:int>" |
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 contextlib | |
| import ctypes | |
| import os | |
| import os.path | |
| import shutil | |
| import sys | |
| import tempfile | |
| @contextlib.contextmanager |
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
| Get-ChildItem -Path . -Recurse -Directory` | |
| | Where-Object {(Get-ChildItem -Attributes Hidden, !Hidden $_.FullName | Measure-Object | %{$_.Count}) -eq 0}` | |
| | Remove-Item |
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 json | |
| import datetime | |
| class DateTimeDecoder(json.JSONDecoder): | |
| def __init__(self, *args, **kargs): | |
| json.JSONDecoder.__init__( | |
| self, | |
| object_hook=self.dict_to_object, | |
| *args, | |
| **kargs |
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 asyncio | |
| import aiohttp | |
| URLS = [ | |
| "https://google.com", | |
| "https://github.com", | |
| "https://example.org", | |
| ] | |
| DONE = {} |
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 asyncio | |
| import aiohttp | |
| URLS = [ | |
| "https://google.com", | |
| "https://github.com", | |
| "https://example.org", | |
| ] | |
| DONE = {} |