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
from types import SimpleNamespace | |
AnsiColors = SimpleNamespace( | |
BOLD_GREEN="\x1b[1;32m", | |
BOLD_MAGENTA="\x1b[1;35m", | |
BOLD_RED="\x1b[1;31m", | |
GREEN="\x1b[32m", | |
GREY = "\x1b[90m" | |
MAGENTA = "\x1b[35m" | |
RED = "\x1b[31m" |
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
import os | |
from collections import deque | |
from collections.abc import Iterator, Sequence | |
from typing import Final, Protocol | |
class SeekableBytesFile(Protocol): | |
def seek(self, position: int, whence: int = ..., /) -> int: ... | |
def read(self, amount: int, /) -> bytes: ... |
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
import ast | |
import sys | |
import keyword | |
import seaborn | |
from pathlib import Path | |
from collections import Counter | |
from dataclasses import dataclass | |
LENGTHS_COUNT = Counter[int]() |
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
from typing import Optional | |
from random import choice | |
class T: | |
def foo(self) -> None: | |
pass | |
var: Optional[T] = choice((None, T())) | |
var.foo() |