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 | |
TOKEN = os.getenv( | |
"BOT_TOKEN", | |
"123:abc", | |
) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 Protocol | |
class MessageCallback(Protocol): | |
__name__: str | |
def __call__( | |
self, | |
message: str, | |
size: 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
import logging | |
# DEFAULT_LOG_FORMAT = "[%(asctime)s.%(msecs)03d] %(funcName)20s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
DEFAULT_LOG_FORMAT = ( | |
"%(funcName)10s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
) | |
def configure_logging(level: int = logging.INFO) -> None: | |
logging.basicConfig( |
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
""" | |
Tested on macOS 11.5 Big Sur | |
SIP disabled | |
admin@MBP-Suren ~ % csrutil status | |
System Integrity Protection status: disabled. | |
run: |
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
[tool.mypy] | |
strict = true |
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
# SOME_SENTENCE = input("Enter a sentence: ") | |
from collections import defaultdict | |
from collections.abc import Iterable | |
SOME_SENTENCE = ( | |
"The cat sat on the mat, " | |
"and the cat played with the mat " | |
"while the cat watched the sun." | |
) |
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 logging | |
# DEFAULT_LOG_FORMAT = "[%(asctime)s.%(msecs)03d] %(funcName)20s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
DEFAULT_LOG_FORMAT = ( | |
"%(funcName)10s %(module)s:%(lineno)d %(levelname)-8s - %(message)s" | |
) | |
def configure_logging(level: int = logging.INFO) -> None: | |
logging.basicConfig( |
NewerOlder