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
# Generated by Powerlevel10k configuration wizard on 2023-07-25 at 02:13 +05. | |
# Based on romkatv/powerlevel10k/config/p10k-lean.zsh, checksum 28361. | |
# Wizard options: nerdfont-complete + powerline, small icons, unicode, lean, 24h time, | |
# 2 lines, dotted, left frame, darkest-ornaments, sparse, few icons, fluent, | |
# transient_prompt, instant_prompt=quiet. | |
# Type `p10k configure` to generate another config. | |
# | |
# Config for Powerlevel10k with lean prompt style. Type `p10k configure` to generate | |
# your own config based on it. | |
# |
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 pickle | |
import io | |
@dataclass(frozen=True) | |
class Foo: | |
x: int | |
@dataclass(frozen=True) | |
class Bar: |
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 random | |
from collections import defaultdict | |
from itertools import islice | |
def batched(iterable, n): | |
"Batch data into tuples of length n. The last batch may be shorter." | |
# batched('ABCDEFG', 3) --> ABC DEF G | |
if n < 1: | |
raise ValueError('n must be at least one') |
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
def anekdot(muzhik: Human) -> Humor: | |
shlyapa: Hat = muzhik.buy_shlyapa() | |
if shlyapa.is_kak_raz(muzhik.head): | |
return Humor.SMESHNO | |
return Humor.NESMESHNO |
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 collections.abc import MutableSequence | |
from typing import Optional | |
class SequenceView(MutableSequence): | |
def __repr__(self): | |
return f"SequenceView([{list(self)}])" | |
def __str__(self): | |
return str(list(self)) |
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 itertools | |
from typing import Iterable | |
def apply_period(word: str, positions: Iterable[int]) -> str: | |
for index, position in enumerate(positions): | |
position += index | |
word = word[:position] + "." + word[position:] | |
return word |
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 | |
from abc import ABC, abstractmethod | |
from typing import Any, Dict, Optional, Tuple | |
from starlette.applications import Starlette | |
from starlette.exceptions import HTTPException | |
from starlette.middleware.base import BaseHTTPMiddleware, RequestResponseEndpoint | |
from starlette.requests import Request | |
from starlette.responses import JSONResponse, Response |
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
disp = { | |
"button_1": ( | |
"Вы выбрали организацию транспортировки.", | |
[ | |
guild.get_role(config.ROLE_ID_TheHeadInnkeeper), | |
guild.get_role(config.ROLE_ID_TheRoyalFamily), | |
guild.get_role(config.ROLE_ID_Courier), | |
guild.get_role(config.ROLE_ID_Porter), | |
guild.get_role(config.ROLE_ID_Security), | |
guild.get_role(config.ROLE_ID_Technician), |
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
func anekdot(muzhyk Human) humor { | |
shlyapa := muzhyk.buyShlyapa() | |
if shlyapa.Size == muzhyk.Head.Size { | |
return Smeshno | |
} else { | |
return NeSmeshno | |
} | |
} |
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
package pipeline | |
import "errors" | |
/* | |
Usage: | |
myPipeline := NewPipeline( | |
NewMyEmitter() | |
) | |
.Plug( |
NewerOlder