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
""" | |
Regular expressions for matching emoji sequences. | |
For parsing single emoji, use either | |
re.match(EMOJI_SEQUENCE, string) | |
# or | |
EMOJI_REGEXP.match(string) | |
To match multiple emojis or custom patterns, insert `EMOJI_SEQUENCE` into pattern: |
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 dataclasses import dataclass | |
import sys | |
from typing import List, TextIO | |
@dataclass | |
class TreeNode: | |
name: str | |
children: List["TreeNode"] |
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
# -*- coding: utf-8 -*- | |
morse_alphabet = { | |
"А" : ".-", | |
"Б" : "-...", | |
"В" : ".--", | |
"Г" : "--.", | |
"Д" : "-..", | |
"Е" : ".", | |
"Ж" : "...-", |
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 asyncio | |
import socketio | |
class AsynchronousSocketServer(socketio.AsyncServer): | |
def __init__(self, *args, **kwargs): | |
kwargs["async_handlers"] = True | |
super().__init__(*args, **kwargs) |