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
from __future__ import annotations | |
from enum import Enum | |
from dataclasses import dataclass, field | |
class Sign(Enum): | |
X = "X" | |
O = "O" | |
class Player(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
{ | |
"params": { | |
"vectors": { | |
"dense": { | |
"size": 1024, | |
"distance": "Cosine" | |
}, | |
"lie": { | |
"size": 1024, | |
"distance": "Cosine", |
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 uvicorn | |
from dishka import Provider, Scope, provide | |
from dishka import make_async_container | |
from dishka.integrations import fastapi as fastapi_integration | |
from dishka.integrations import faststream as faststream_integration | |
from dishka.integrations.base import FromDishka as Depends | |
from dishka.integrations.fastapi import DishkaRoute | |
from dishka.integrations.faststream import inject as faststream_inject | |
from fastapi import FastAPI, APIRouter | |
from faststream import FastStream |
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
T = TypeVar('T') | |
class DependencyKey(Generic[T]): | |
__slots__ = ('key',) | |
def __init__( | |
self, tp: type[T] | None = None, dependency_key: str | None = None | |
) -> None: |
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
from aiogram import Bot | |
from aiogram.fsm.state import State, StatesGroup | |
from aiogram.types import Message, CallbackQuery | |
from aiogram_dialog import Dialog, DialogManager, Window | |
from aiogram_dialog.widgets.input import TextInput, ManagedTextInput | |
from aiogram_dialog.widgets.kbd import WebApp, Button, Cancel, SwitchTo | |
from aiogram_dialog.widgets.text import Const, Format | |
from dishka import FromDishka | |
from loguru import logger |
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
with coins_cte as (select c.request_id, | |
jsonb_agg( | |
jsonb_build_object( | |
'url', url, | |
'address', address, | |
'symbol', symbol, | |
'amount', amount | |
) | |
) as coins | |
from hamster_schema.request_coins c |
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
from typing import TypeVar, ParamSpec, Callable | |
from fast_depends import inject | |
from fast_depends.dependencies.provider import Provider | |
T = TypeVar("T") | |
P = ParamSpec("P") | |
class Container(Provider): | |
def execute( |
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 logging | |
import sys | |
from dataclasses import dataclass | |
import adaptix | |
@dataclass | |
class ExecutionData: |
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
logger = logging.getLogger(__name__) | |
class Application: | |
def __init__( | |
self, | |
config: Config, | |
app: FastAPI | |
) -> None: | |
self.config = config |
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 logging | |
from dataclasses import dataclass | |
from typing import Callable, Any, NamedTuple | |
from telethon import TelegramClient | |
from telethon.events import NewMessage | |
from telethon.events.common import EventBuilder | |
Handler = Callable[[Any], None] |
NewerOlder